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.
The gnome-open command will open a directory with the appropriate application, which in this case is Nautilus:
This will open the directory /tmp using the Nautilus file browser.
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.pdfwill open the PDF in a PDF browser.
gnome-open file.zipwill 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.
As of 2018, one can use the GIO commandline tool on Gnome:
gio open some/directory
For me the safest way that is compatible with almost all environments is xdg-open
This would open a directory named test (for example) under your home directory.
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.
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.