Advertisement

Friday 27 July 2012

Linux--Ubuntu reference terminal commands and Cheat sheet

Linux--Ubuntu reference terminal commands 

and Cheat sheets



Enter these commands in TERMINAL==>

To open TERMINAL:
Press Ctrl+Alt+T simultaneously.

ALSO PREFIX ALL THE BELOW COMMANDS WITH::sudo

Priviledges Commands:

  1. sudo command – run command as root
  2. sudo -s – open a root shell
  3. sudo -s -u user – open a shell as user
  4. sudo -k – forget sudo passwords
  5. gksudo command – visual sudo dialog (GNOME)
  6. kdesudo command – visual sudo dialog (KDE)
  7. sudo visudo – edit /etc/sudoers
  8. gksudo nautilus – root file manager (GNOME)
  9. kdesudo konqueror – root file manager (KDE)
  10. passwd – change your password

System Services:

  1. start service – start job service (Upstart)
  2. stop service – stop job service (Upstart)
  3. status service – check if service is running (Upstart)
  4. /etc/init.d/service start – start service (SysV)
  5. /etc/init.d/service stop – stop service (SysV)
  6. /etc/init.d/service status – check service (SysV)
  7. /etc/init.d/service restart – restart service (SysV)
  8. runlevel – get current runlevel 
  9. Recovery - Type the phrase “REISUB” while  holding down Alt and SysRq (PrintScrn) with about 1 second between each letter. Your system will reboot.
  10. lsb_release -a – get Ubuntu version
  11. uname -r – get kernel version
  12. uname -a – get all kernel information

Package Management:

  1. apt-get update – refresh available updates
  2. apt-get upgrade – upgrade all packages
  3. apt-get dist-upgrade – upgrade with package
  4. replacements; upgrade Ubuntu version
  5. apt-get install pkg – install pkg
  6. apt-get purge pkg – uninstall pkg
  7. apt-get autoremove – remove obsolete packages
  8. apt-get -f install – try to fix broken packages
  9. dpkg --configure -a – try to fix broken packages
  10. dpkg -i pkg.deb – install file pkg.deb
  11. (file) /etc/apt/sources.list – APT repository list

Special Packages:

  1. Ubuntu-desktop – standard Ubuntu environment
  2. Ubuntu-desktop – KDE desktop
  3. Ubuntu-desktop – XFCE desktop
  4. Ubuntu-minimal – core Ubuntu utilities
  5. Ubuntu-standard – standard Ubuntu utilities
  6. Ubuntu-restricted-extras – non-free, but useful
  7. Ubuntu-restricted-extras – KDE of the above
  8. Ubuntu-restricted-extras – XFCE of the above
  9. build-essential – packages used to compile
  10. programs
  11. Linux-image-generic – latest generic kernel
  12. image
  13. Linux-headers-generic – latest build headers

Network Commands:

  1. ifconfig – show network information
  2. iwconfig – show wireless information
  3. sudo iwlist scan – scan for wireless networks
  4. sudo /etc/init.d/networking restart – reset network for manual configurations
  5. (file) /etc/network/interfaces – manual configuration
  6. ifup interface – bring interface online
  7. ifdown interface – disable interface

Firewall Commands:

  1. ufw enable – turn on the firewall
  2. ufw disable – turn off the firewall
  3. ufw default allow – allow all connections by default
  4. ufw default deny – drop all connections by default
  5. ufw status – current status and rules
  6. ufw allow port – allow traffic on port
  7. ufw deny port – block port
  8. ufw deny from ip – block ip adress

Display Commands:

  1. sudo /etc/init.d/gdm restart – restart X and return to login (GNOME)
  2. sudo /etc/init.d/kdm restart – restart X and return to login (KDE)
  3. (file) /etc/X11/xorg.conf – display configuration
  4. sudo dexconf – reset xorg.conf configuration
  5. Ctrl+Alt+Bksp – restart X display if frozen
  6. Ctrl+Alt+FN – switch to tty N
  7. Ctrl+Alt+F7 – switch back to X display

Application Commands:

  1. nautilus – file manager (GNOME)
  2. dolphin – file manager (KDE)
  3. konqueror – web browser (KDE)
  4. kate – text editor (KDE)
  5. gedit – text editor (GNOME)

NOTE:In order to open other application just write the NAME of the Application and hit Enter.


Now get your Linux cheat sheet pdf on these links: