Working a Linux terminal for the first time can be daunting, but once you’re familiar with the basic commands and command types, you’ll soon become familiar enough to work without a cheat sheet.
Until that day, here’s a look at all of the basic Ubuntu Linux commands that you need to know.
On a Ubuntu 18.04 installation you can find a launcher for terminal by clicking on the Activities item at the top left of the screen, then typing the first few letters of “terminal”, “command”, “prompt” or “shell” or hit the keyboard shortcut Ctrl–Alt+T.
Must-Know Basic Commands for Beginners
sudo
sudo is a command and abbreviation of ‘Super User Do’ allowing programs to execute with root user (super user) or other specified user account privileges.
apt-get
‘apt’ refers to the “Advanced Package Tool” while ‘apt-get’ retrieves software packages used for installation and upgrades to existing software.
dpkg -list
lists all currently installed packages.
sudo apt-get update
Retrieves information concerning what updates are available to currently installed packages from online sources.
sudo apt-get upgrade
Installs all available upgrades for currently installed packages from online sources.
sudo apt-get install
Used to install a package from an online source.
sudo apt-cache search [package name]
Searches for available packages from online sources.
sudo apt-get remove
Uninstalls an installed software package without purging the configuration, plugins, and settings.
sudo apt-get purge
Removes an installed software package including its configuration, plugins, and settings.
sudo apt-get autoremove
Clears packages previously installed as dependencies that are no longer required by currently installed software.
File Commands
ls
‘ls’ references “list,” and is used to list the files and folders within a directory.
ls-al
Shows a long listing of the files and folders within a directory.
cd
‘cd’ references “change directory,” and is used to switch the working directory you’re operating in.
cd dir
Changes directory to a specific location on your storage.
pwd
‘pwd’ references “Print Work Directory” and provides you the full pathname of the current working directory.
mkdir [dir]
‘mkdir’ references “Make Directory” and using the command ‘mkdir dir’ create a directory in the place of “dir” according to the name used, in the working directory.
rm [file]
‘rm’ references “Remove” and executes the removal of the file specified.
rm -r dir
‘-r’ references “Recursive Mode” and removes a directory and all of its contents.
rm -f [file]
‘-f’ references “Forced” and forcibly removes a file regardless of its permissions.
rm -rf [dir]
Removes a directory and all of its contents regardless of the individual file permissions.
cp [file1] [file2]
‘cp’ refers to “Copy” and using this command copies one file to a file of a different name, leaving the original intact and creating the new file.
mv [file1] [file2]
‘mv’ refers to “Move” and using this command moves one file to a file of a different name (and place if specified,) the original is not retained but rather literally moved to the new filename and location.
Ubuntu Shortcut Keys
SUPER Key (Windows Button) | Opens Activities Search |
CTRL + ALT + T | Open Terminal |
SUPER + L or CTRL + ALT + L | Lock Screen |
SUPER + D or CTRL + ALT +D | Show Desktop |
SUPER +A | Show Application Menu |
SUPER + TAB | Switch Between Running Applications |
SUPER + ARROW KEYS | Snap Windows To Given Direction |
SUPER + M | Toggle Tray Notification |
SUPER + SPACEBAR | Change Input Keyboard (Multiple Languages) |
ALT + F2 | Quick Command Console for Power Users |
CTRL + Q or CTRL + W | Close Application |
CTRL + ALT + ARROW Key | Move Through Workspaces |
CTRL + ALT + DEL | Log Out |
ALT + ESC | Quick Switch Between Two Applications |
SUPER + V | Notification list |
CTRL + A | Select All |
CTRL + X | Cut |
CTRL + C | Copy |
CTRL + V | Paste |
CTRL + Z | Undo Last |
PRNT SCRN | Screenshot |
ALT + PRNT SCRN | Screenshot Active Window |
SHIFT + PRNT SCRN | Screenshot Screen Area (Drag-and-Drop) |
CTRL + ALT + SHIFT + R | Start and Stop Screencast Recording |