Linux Command Cheat Sheet
Linux Command Cheat Sheet
Linux Command Cheat Sheet
Use [command] --help if you want to know all of the available options for each command!
Console
Command / Action Result
Press Shift+Page Up / Page Down Scroll the console up or down
Up / Down arrows Will enter the last used commands
Press Tab Will autocomplete your text where possible (remember Linux is case sensitive on
EVERYTHING)
clear Clears the screen of all text
--help Shows help for current command – usage example: “shutdown --help”
shutdown Shuts down the server – usage example: “shutdown -r now” or “shutdown now”
logout Logs the current user out of the system
grep Filter for text
User Commands
Command Result
sudo Elevated permissions
su Switch user – sudo su – su user2 – etc…
adduser username Create a user account
deluser username Delete a user account
passwd username Reset a user account password
Navigation
Command Result
ls List all of the folders / files in current directory (use ls –a) to show hidden files
cd Change Directory – usage example: “cd ..”; “cd /”; “cd /home/desktop” etc…
Package Management
Command Result
apt-get install [package name] Install a package (apache for example)
apt-get purge [package name] Uninstall program
dpkg –l List installed packages
Network Management
Command Result
ifconfig -a List all network information
Ifconfig eth0 10.0.0.20 Set the IP of eth0 to 10.0.0.20