File Manager with Sessions (or save state)

Several years ago I used to run the Nautilus file manager. When I left Linux I was in discussion with a couple of the developers and there seemed to be a lot of interest in having Nautilus save it’s state. For anyone not familiar with what this means; imagine that you have two or three Nautilus windows open at the same time, each with two or more tabs open and then your system crashes. Saving the ‘state’ means that it will open up the exact same way you left it.

Today I am running Caja. Does anyone know a way that this can be done. Or perhaps they have another file manager that can be recommended. Saving states, and perhaps sessions of a file manager is something I find very useful.

Thank you …

Haha, I found it. This thread on LinuxQuestions was dated back to 2006 which shows how long ago some of these features were that I was using in Linux Mint. I really like session saving; not only in my file manager but also in my GUI.

I was literally thinking about this today. Wow! I was in the process of wrapping a video edit to restart my main desktop (which I don’t restart often) and I was thinking how great it would be if all of my Nautilus windows would reopen to the paths they were on.

On my end, I’m having nothing but problems with Nautilus. It seems like after a while, Nautilus just gets weird. Currently, it’s impossible to access my trash folder through Nautilus. I can with pcmanfm though. Personally, I think GVFS is too unstable and the fact that Nautilus relies on it annoys me (it’s just a file manager, darn it).

Did you find any additional info since your post?


After watching a a couple of videos on file managers it seems that Dolphin has this restore feature I am looking for. I haven’t tried it however, not yet. For now I’ve been busy off my computer for a few days while I work on some metal fabrication. I’m building some shelves for my workshop :relaxed:

That kinda makes sense. When I was using Plasma and powering off my laptop, everything would just reopen back up, not just Dolphin. I don’t remember if I was using Ubuntu+KDE, Kubuntu, Arch or Fedora KDE Spin.

Now, I either don’t reboot often (although I do update frequently and check which binaries need reloading / restarting), or I try to keep whatever I have open easily accessible. I’ve been using nnn for a year exclusively and I can’t really go back now. I’m somewhat organized, so I know where most of my files reside and I know what folders I need to open manually and with the keyboard, it doesn’t take more than a couple keystrokes.

Back when I was a MSWindows guru, circa 2004 and before, I created a batch file that I would execute from the command line. The batch file would execute on startup. And I set it up so all i had to do was select a number 1 through 7.

Each number would open up a predetermined set all applications and corresponding directories in the file manager. It was fairly easy to maintain since I only had to copy and paste directory paths when needed.

I bet I can do this using a BASH script though I have ten other projects that I need to get through before I start playing with that :relaxed:

If you don’t mind having multiple file manager windows open, as opposed to opened tabs, then it’s as easy as doing a script to get you to a place and then open the FM.

cd /home/user/Documents
pcmanfm-qt > /dev/null 2>&1 &

Or to ask you for input of a number corresponding to a predefined path, do:


print_help () {
        printf "1 = /home/${USER}/\n1 = /home/${USER}/Documents\n3 = /home/${USER}/Downloads\n4 = /home/${USER}/Desktop\n"

if [ "${1}" = "" ]
        read -p "Which path: " numbvar

case ${numbvar} in
                cd /home/${USER} && pcmanfm-qt > /dev/null 2>&1 &
                exit 0
                cd /home/${USER}/Documents && pcmanfm-qt > /dev/null 2>&1 &
                exit 0

                cd /home/${USER}/Downloads && pcmanfm-qt > /dev/null 2>&1 &
                exit 0

                exit 0

exit 1
1 Like

I’m looking at what you posted here and considering it together with Whiptail. What do you think? Have you done anything with Whiptail before? Do you think that this is making it easier for what I have in mind, or harder :slight_smile:

No idea what whiptail is, I’ll check later.

1 Like

So, whiptail is a TUI that lets you combine scripts with a supposedly user friendly input. I think it overcomplicates what I wrote in the previous script. That script can either be combined with another script that invokes all the numbers at once or can be used separately to quickly open tagged folders on demand, either by itself in a terminal, or via a launcher like dmenu / bemenu.

It would look something like this:

Well, that is, if you have your script path in your environment variables, or you can symlink it to your scripts in your home folder.

The reason why I avoid TUIs and GUIs and stay to the Unix philosophy is precisely because of this flexibility to combine scripts with other scripts or with other tools. Well, I haven’t really made use of bemenu that much, I use it only as a glorified program launcher, but bemenu and friends can do much more than this if you get a bit creative.

1 Like

I wonder if it would make sense to build a wrapper via a script, and have it check the process list for running file managers, grab the directories they’re attached to, and then save the paths to a file on close. Then, the wrapper script could be used to open the file manager and also convert the directory list that was saved previously to a set of arguments for the file manager.

It works out in my head at least, but unfortunately I probably wouldn’t have the time to develop it right now.


I feel you on the time. Between the metal fabrication I’m doing in my shop, the homeschooling I’m doing with my eleven and twelve year old, and the just being a good husband stuff; it’s hard to find the time for the other stuff.

But “it’s on the list” :grin:

1 Like