Show Menu
Cheatography

Ubuntu Generic Commands Cheat Sheet (DRAFT) by

Basic Terminal Commands for Ubuntu Users

This is a draft cheat sheet. It is a work in progress and is not finished yet.

File Commands

ls
Directory Listing
ls -al
Formatted Listing with Hidden Files
cd dir
Change Directory to dir
cd
Change Directory to home
pwd
Show Current Directory
mkdir dir
Make New Directory dir
rm file
Remove File file
rm -r dir
Remove Directory dir
rm -f file
Force Remove File file
rm -rf dir
Force Remove Directory dir
cp file1 file2
Copy file1 to file2
mv file1 file2
Rename­/Move file1 to file2
ln -s file link
Creates a Symbolic link to file
touch file
Create or Update file
cat > file
Place Standard Input into file
more file
Output Contents of file
less file
Output Contents of file
head file
Output First 10 Lines of file
tail file
Output Last 10 Lines of file
tail -f file
Output Contents of file as it Grows

System

uname -a
Display Linux System Inform­ation
uname -r
Display Kernel Release Inform­ation
uptime
Show how long the system has been running + load
lsb_re­lease -a
Get Ubuntu Version
 

Privelages

sudo command
Run command as Root
sudo -s
Open a Root Shell
sudo -s -u user
Open a Shell as user
sudo -k
Forget sudo Passwords
gksudo
Visual sudo Dialog (GNOME)
kdesudo
Visual sudo Dialog (KDE)
sudo visudo
Edit /etc/s­udoers
passwd
Change Your Password

Package Management

apt-get update
Refresh Available Updates
apt-get upgrade
Update All Packages
apt-get dist-u­pgrade
Upgrade Ubuntu Version
apt-get install pkg
Install pkg
apt-get purge pkg
Uninstall pkg
apt-get -f install
Try to Fix Broken Packages

Hardware

dmesg
Detect Hardware and Boot Messages

Network

ifconfig
Display Network Inform­ation
iwconfig
Display Wireless Inform­ation
ifup inter­face
Enable inter­face
ifdown inter­face
Disable inter­face