Open Gnome Nautilus File Manager For The Current Linux / Unix Command Line

Posted on in Categories , , last updated May 12, 2015

Nautilus is the file manager for the GNOME desktop. How do I open Nautilus from the Linux or Unix shell prompt to open files and directories on a Linux or Unix based desktop?

You can use the gnome-open command to open files and URLs using the GNOME file handler, ust as if you had double-clicked the file’s icon. If the file is in the form of a URL, the file will be opened as a URL. If you are using KDE or other desktop try:

xdg-open command ## generic version ##


kde-open command ## kde ##


open command ## osx ##


For example, if you were in the /home/vivek directory, typing the following command would open the file manager:

gnome-open .

Sample outputs:

Linux / Unix: gnome-open Open a Directory File Browser Command
Fig.01: gnome-open in action

The . (dot) is your current directory. If you type two dots ( .. ) it would open the parent directory:

gnome-open ..

To open a directory in Nautilus, enter:

## home dir ##
gnome-open ~
## /tmp ##
gnome-open /tmp

To open a web page or url:
To open an document file
gnome-open resume.odf
To open a pdf file:
gnome-open lsst.pdf
To Send an e-mail:
gnome-open mailto:[email protected]
To open an URL:
gnome-open ''

A note about KDE and other *nix desktop users

You can use kde-open or xdg-open to open a file, directory or URL in the user's preferred application. The syntax is same:

kde-open .
xdg-open .
kde-open '' 
xdg-open '

You can also use kfmclient under KDE desktop for opening URLs from the command line. To opens the current directory:

kfmclient exec .

To open the file:

kfmclient exec file:/home/vivek/test.html

To opens the file with firefox:

 kfmclient exec file:/var/www/html/docs.en.html Firefox

To open new window with URL:

kfmclient exec
kfmclient exec

Putting it all together

You can use the following bash for loop examples to open 5 random pages from Wikipedia:

for J in {1..5} 
## OS X specific example ##
for J in {1..5} 

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

2 comment

  1. Hi thanks for sharing this.
    I am getting this error:

    [email protected]:~> gnome-open
    Error showing url: Error stating file '/home/rahul/': No such file or directory

    Please help to solve this.

    Thanks again :)

Comments are closed.