How to open Nautilus at current command line directory?

You can type in the terminal:

cd /home/myUser/some/long/path/to/a/directory

and then:

nautilus .

The above command will open nautilus in the folder /home/myUser/some/long/path/to/a/directory (the period is the current directory)

Or in the Terminal just type:

nautilus /home/myUser/some/long/path/to/a/directory

You can also do gnome-open .. gnome-open is similar to open on Mac which tries to open the file using the best matching application. By default, gnome-open . on Ubuntu will open the current directory in Nautilus.

There is an open command in Ubuntu as well but it does not work in this case.


In order to avoid nasty warnings in my terminal I use nohup. To have it detached from my terminal I'm adding & at the end of my command. I also use the -w flag to open in a new window.

nohup nautilus -w . &

Note that, nohup will create a file with warnings.

You can send that to /dev/null like this:

nohup nautilus -w . > /dev/null &

EDIT:

If you don't want to type all of this all everytime you want to open nautilus, you can make a function and place it in your .bashrc or into a file that is sourced when you open your console.

open() {
    nohup nautilus -w $1 > /dev/null 2>&1 &
}

You could then use :

$ open path/to/open/

I would prefer that over an alias as mentioned here since it allows you to specify the path to open in nautilus.