Opening the file browser from terminal
nautilus --browserwill 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.
simply you can type nautilus in command text. I have done the same shorcut using Win+E for opening nautilus
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-opencommand 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
opencommand, for those of us who use Macs.
To update this answer: gnome-open is now called gvfs-open. If you want a desktop-agnostic command, you can also use xdg-open.
This leaves the terminal hanging awaiting more input, so you have to kill with Ctrl-C
@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.
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.
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.
I put the following line in my
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`.
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-opencommand, which itself often aliased as the
browsecommand if that's more your style.
xdg-openships natively with Ubuntu.
xdg-opencan 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.caLaunches 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-opencan be found here
Note that the xdg-open command is not meant to be used with root priveleges.