Opening a file from terminal

xdg-open file.dvi

xdg-open will open any file with its default application. As a bonus, you can close the terminal without killing the application.

Since xdg-open is quite a long name, I put an alias for it in .bashrc:

alias open='xdg-open'

okular file.dvi &

just append an & to make your command running as separate process.


okular file.dvi &> /dev/null & would be a bit better. This way, the program does not write to the terminal.

If you use just okular file.dvi & the program will still report things on the terminal, often in the middle of your work