Open a file or directory from the terminal

There are a few tools that open a file or a directory from the terminal. This commands can be very usefull and easy to use, if you alias them.

Watch Free Movies
  • gnome-open /path/to/file_or_dir
  • xdg-open /path/to/file_or_dir
  • okular /path/to/file_or>dir

Because okular belongs to KDE environment, you may not have it installed, if you are using gnome.

Install okular:

  • In Debian / Ubuntu / Linux Mint : sudo apt-get install okular
  • In Fedora / CentOS : sudo yum install okular
  • openSUSE : sudo zypper install okular

Alias these commands, to type less:

alias go='gnome-open &> /dev/null &'

OR:

alias go='xdg-open &> /dev/null &'

OR:

alias go='okular &> /dev/null &'

I have redirected the stdout and the stderr to /dev/null (thrown them away) and used the & character to send the process into background.

$ go .
$ go /etc/passwd

Scroll to Top