How do I change the default file manager from the terminal?

I have Dolphin, Nemo, and PCManFM installed. How do I change the default file manager from Thunbar to Dolphin from the terminal and not using a GUI?

1 Like

I believe


might be what you are looking for, otherwise take a peek at the wiki.

What’s wrong with just using the gui?

1 Like

I did more looking, the gui aplication


Is all I’ve come up with, xfce uses this.

I can’t find a documented way to do what you’re asking for.

1 Like

Hi, maybe…
· Using xdg-mime, You could also run the following command to determine your current default file manager:
xdg-mime query default inode/directory
In your case, this should return thunar.desktop as a result.
In order to change this, run:
xdg-mime default dolphin.desktop inode/directory application

· You can edit the file ~/.local/share/applications/mimeapps.list
look for the line containing inode/directory=thunar.desktop
change it to read inode/directory=dolphin.desktop


I have also installed nemo, and it always gives me the output “nemo.desktop” no matter what I do. I changed the default file manager and set it to Dolphin, but xdg-mime commands tell me it’s “nemo.desktop”.

and uninstalling nemo…

1 Like

Don’t crosspost; conversely, don’t post to a solved topic.

1 Like

The topic you linked

has this comment marked as solution by the OP. That means it worked for them.

You call it unsolved when it was solved 7 days before you added the last comment.

Please do not escalate by patronizing other forum members!

In the wiki link provided by @merlock it is explained clearly what to edit manually. Is the more detailed version of what other topic mentioned. Since you are on Xfce then follow this part of it:

1 Like

The right name of the .desktop file of Dolphin is org.kde.dolphin.desktop.
You can confirm this by running:

ls -l /usr/share/applications/ | grep -i "dolphin"

This is the file that you have to edit - using the correct name for the .desktop file - since it supersedes any other file for the current user in the system.

If you want to use the terminal, you can run:

xdg-mime default org.kde.dolphin.desktop inode/directory

After that, open the Preferred Applications window by running exo-preferred-applications in a terminal and in the Utilities tab change the File Manager option, by picking (or inserting) /usr/bin/dolphin.
This will create a new entry in the ~/.config/xfce4/helpers.rc file, which will point to a new .desktop file (usually called custom-FileManager) in the directory ~/.local/share/xfce4/helpers/.

To test if everything works as expected, you can run these commands

xdg-open ~/Downloads
exo-open ~/Downloads
gio open ~/Downloads

and see if the ~/Downloads directory is going to open in Dolphin.

1 Like

Using a GUI isn’t half as satisfying, in my opinion.

1 Like

Thanks to @bill_t advice this is the command that replace the default manager variable in user’s file by the dolphin variable:

appname=$(ls -A1 /usr/share/applications/|grep -i dolphin) && sed -i "/inode\/directory/d" ~/.config/mimeapps.list;echo "inode/directory=$appname" >> ~/.config/mimeapps.list

Transmission app now opens Dolphin. But fsearch still opens Thunar :-/

Though better to use bill_t command likely:

xdg-mime default org.kde.dolphin.desktop inode/directory

but fsearch still opens folders in Thunar

bill_t command “exo-preferred-applications” shown Thunar as a manager and i was able to select dolphin and then all apps seems to open Dolphin as i wanted. :white_check_mark:

As Bill written, it appended line “FileManager=custom-FileManager” to ~/.config/xfce4/helpers.rc and created ~/.local/share/xfce4/helpers/custom-FileManager.desktop with content:

[Desktop Entry]
X-XFCE-CommandsWithParameter=/usr/bin/dolphin “%s”

maybe it would work to create this file manually, if it is worth to someone, unless there is other cmd utility that works without gui.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.