Skip to content

Instantly share code, notes, and snippets.

@Komi7
Last active April 27, 2023 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Komi7/7cfc3a86c1f53ad71929358d181eb43c to your computer and use it in GitHub Desktop.
Save Komi7/7cfc3a86c1f53ad71929358d181eb43c to your computer and use it in GitHub Desktop.
How to Change the Default Linux File Manager

Find The Default File Manager

To determine the default file manager run the following command.

xdg-mime query default inode/directory
codium.desktop

Change The Default File Manager

In order to change the default manager you have to know what the desktop entry file name is called. Desktop entry files are typically stored at a couple location on a Linux system, “~/.local/share/applications/” for user-specific applications, and “/usr/share/applications/” or “/usr/local/share/applications/” for applications installed system-wide. Try locating the application name by browsing each of those directories listed or searching by using the find command.

Here is an example of a search for GNOME Files (nautilus) within the directory “/usr/share/applications/”.

find /usr/share/applications/ -iname "*pcmanfm*"
/usr/share/applications/pcmanfm.desktop
/usr/share/applications/pcmanfm-desktop-pref.desktop

The below command example will set GNOME Files (nautilus) as the default file manager.

xdg-mime default pcmanfm.desktop inode/directory

To verify if the change worked, you can run the following command.

xdg-mime query default inode/directory
pcmanfm.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment