Ubuntu terminal commands cheat sheet

File commands

Show current dirrectorypwd
Show all files and folders in current directoryls
Change directory


e.g. cd usr

Navigate to root directory cd /

Navigate to home directory cd ~

Navigate up one level cd ..

Navigate back one level cd –

Make new folder in current location


e.g. mkdir newfolder

Remove file or directory


Caution: rm -r can be used to remove a directory and all files and folders inside.

System commands

“SuperUserDo” – prefix to command to run command as root user


e.g. sudo ls

Update Advanced Packaging Tool (APT) package manager – retrieves latest package listsudo apt-get update
Install software packagesudo apt-get install vlc

Update currently installed software package

Note: this is done by tying together both the apt update and install commands.

sudo apt-get update && sudo apt-get install vlc

Restart computer
sudo reboot
Shutdown computersudo poweroff

System information

Display operating system version lsb_release -a
 Display kernel versionuname -a
Display filesystem disk usage for all mounted partitionsdf -h
Display free and used memory (system  RAM)free -m
Display network interfaces and assigned IP addressesip addr show


Was this article helpful?

Related Articles