Ubuntu terminal commands cheat sheet

File commands

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

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 locationmkdir

e.g. mkdir newfolder

Remove file or directoryrm

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 usersudo

e.g. sudo ls

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

e.g. sudo 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


Related Articles

Leave a Reply

Your email address will not be published.