I'm working on different Linux distributions.

In my .bashrc I'd like to set up an alias that opens a window of the default file manager (e.g. nautilus, nemo, pacman, ...).

Is there a way find out what the file-manager of a session is? (It does also depends on the session, doesn't it?)

  • 8
    xdg-open . works in all desktop environments using the default file manager – Rahul Aug 9 '16 at 12:14

As comments have already stated, you're probably better off with xdg-open (no alias needed), but to answer the question: You can use xdg-mime to query and set default applications. To get the default file manager:

xdg-mime query default inode/directory

Read more about this topic in the xdg-mime manual or the Arch Wiki.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.