What's the command to open the file browser? I want it so that I can assign a keyboard shortcut to open a specific folder.

  • I add an & after command, whatever it is, so the terminal stays available for new commands. Appending space & after a command runs it in its own environment, dissociating it from the terminal. – Juan Lanus Sep 14 '20 at 14:31

10 Answers 10


nautilus --browser will ensure that Nautilus is launched in browser mode even if you're normally using it in spatial mode.

You can append the path you want to open to the end:

nautilus --browser ~/some/directory
  • But the problem I have with nautilus is that it has root permissions. How can I avoid that? I don't want to accidentally delete any files. – Jon Doe Oct 21 '10 at 0:03
  • 4
    It shouldn't have root permissions unless you launch it with gksudo. – mgunes Oct 21 '10 at 0:11
  • simply you can type nautilus in command text. I have done the same shorcut using Win+E for opening nautilus – Amit Rane Mar 28 '15 at 13:45
  • 1
    this seems to work OK, but throws a ton of errors for me and others. – Jeff Puckett Jul 26 '16 at 19:26

The gnome-open command will open a directory with the appropriate application, which in this case is Nautilus:

gnome-open PATH

This will open the directory /tmp using the Nautilus file browser.

gnome-open /tmp


cd /tmp
gnome-open .

I like the gnome-open command because you can use this exact same command to open a file with the appropriate application. No need to remember any funny flags. It just works.

  • gnome-open file.pdf will open the PDF in a PDF browser.
  • gnome-open file.zip will open a zip file using the Zip archive viewer.

It's also similar in name and function to the Mac OS X open command, for those of us who use Macs.

  • 16
    To update this answer: gnome-open is now called gvfs-open. If you want a desktop-agnostic command, you can also use xdg-open. – Jason Champion Mar 21 '15 at 5:12
  • This leaves the terminal hanging awaiting more input, so you have to kill with Ctrl-C – Jeff Puckett Jul 26 '16 at 19:18
  • 1
    @JeffPuckettII In my experience, gnome-open file.ext will open a file, hand it off to another program and then exit. It does not hang awaiting for more input, at least not on my Ubuntu 14.04 box at home. – Stefan Lasiewski Jul 27 '16 at 20:26
  • 9
    To update @JasonChampion's update: gvfs-open is now deprecated, replaced by a small shell script that calls gio open. xdg-open is also a wrapper script, and on most Ubuntu systems it's likely to call gio open. gnome-open still exists as a binary distinct from gio – scruss Mar 24 '18 at 13:21

As of 2018, one can use the GIO commandline tool on Gnome:

gio open some/directory

Edit: Another option is xdg-open. Also take a look at this answer for further details.


For me the safest way that is compatible with almost all environments is xdg-open

xdg-open $HOME/test

This would open a directory named test (for example) under your home directory.

  • 1
    this is the better answer, compared the accepted answer. The reason is: nautlius opens a folder but it hangs the command line until you closed the opened File Explorer, but this one opens the file explorer and you can still use command line. – Franva Mar 12 '20 at 11:19
  • For me, this option also hangs the command line... (Ubuntu 18.04) – Dustin Michels Apr 27 '20 at 8:50
  • A general rule for all GUI application is: if you don't want them to hang the command line, run them in background, ie. add & at the end of the command. Like: nautilus --browser & – raj Jan 20 at 11:31

I put the following line in my .bashrc:

alias opn="nautilus -s ."

Now you can open with

$ opn /path/to/folder
  • There is a command named open already in package kbd, it's linked to openvt. – Volker Siegel Sep 2 '14 at 9:53
  • Working in Ubuntu 18.04 too, unlike some of the other answers here. – nonbeing Jun 30 '18 at 14:16

For reference, I'm running Ubuntu Bionic 18.04.

The easiest and safest way I open the file explorer from command line is with the xdg-open command, which itself often aliased as the browse command if that's more your style. xdg-open ships natively with Ubuntu.

xdg-open can also open any file or web URL, and will open it according to your computer's default application for files of that filetype.


browse . Opens the file explorer in my current directory.

xdg-open ~ Does the same, but my home directory.

xdg-open https://www.google.ca Launches google's homepage with your default browser (xdg-open will open it as a new tab if a browser session is already open).

Man pages for xdg-open can be found here

Note that the xdg-open command is not meant to be used with root priveleges.


You can use

  • nautilus PATH for the Gnome
  • nemo PATH for the Cinnamon
  • caja PATH for the MATE
  • thunar PATH for the Xfce

Since I am used to explorer . I add an alias to my linux systems.

echo 'alias explorer="gio open"' >> ~/.bashrc

On a new terminal I can:

explorer .

Use nautilus

For root file browsing, it's gksudo nautilus.

  1. Using nautilus for current directory -> nautilus ./
  2. Using gnome-open for current directory -> gnome-open ./
    For gnome-open if might be required to install sudo apt install libgnome2-bin

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.