Useful Linux Terminal Commands

Here are some useful and helpful commands which is generally used in day to day workings on the Linux system. Following commands were tested on the Ubuntu/Debian Linux.

To fix the broken packages
$ sudo apt-get install -f


Removing automatic installed packages
$ sudo apt-get autoremove


Check Gnome Shell version
$ gnome-shell --version

Current Kernel Version
uname -r


Compress PDF file using ghostscript
$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf


Open help and options info of a command
$ man <command>


Short help info of any command
$ <command> --help


Make ISO of A Directory
An ISO of a directory containing files and sub-directories can be made using this command.
mkisofs -o image.iso -R /path/to/folder/

Force Kill Application
Run following terminal command then click the application’s window to close it.
xkill


Logout without prompt
$ pkill -KILL -u $USER


Create an ISO image of CD/DVD
sudo cat /dev/sr0 > foo.iso