xdg-open . instead of
nautilus . (both manually and in aliases) to open Nautilus.
The precise effect of running
nautilus in the terminal depends on factors that include whether or not
nautilus is already running. When you start an instance of
nautilus from the terminal and it detects an existing instance, it tells that instance what to do and quits; when it doesn't, it keeps running. You can use
xdg-open instead, which is usually the best way to open a file or directory in a graphical program, and which quits immediately whether or not an instance of the program was already running.
To open a graphical file browser window for the current directory, you can use:
That command causes
. (the current directory) to be opened by whatever program is configured to handle directories. The command itself immediately terminates. If your desktop environment uses Nautilus as its file browser, then the effect is to open it in Nautilus.
If you're using a desktop environment that doesn't use Nautilus as its file browser--or if you've manually reconfigured what graphical program is responsible for opening directories--then typically you would want that other program to run instead, anyway. For example, Xubuntu uses Thunar as its file browser, and running
xdg-open . in an Xubuntu session opens the current directory in Thunar, which is what you would probably want in that situation.
The directory you open doesn't have to be
.. For example,
xdg-open ~/Downloads opens your downloads folder.
xdg-open command can also be used to open things that are not directories. For example, if you have a LibreOffice Writer document
xdg-open notes.odt will open that in LibreOffice Writer.
In my experience, most of the time one considers running
nautilus some-directory, what one wants is exactly the effect produced by
If you want a Bash alias for this--that is, specifically to open the current directory--you can still make one:
alias open='xdg-open .'