Working on 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 the basic Ubuntu Linux commands you need to know.
In an installation of Ubuntu 18.04 you can find a launcher for terminal by clicking on the Activities item at the top left of the screen, then typing the first letters of “terminal”, “command”, “prompt” or “shell” or pressing the keyboard shortcut Ctrl-Alt + T.
Basic commands essential for beginners
sudo
sudo is a command and abbreviation for ‘Super User Do’ that allows programs to run with root (superuser) 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 updates of existing software.
dpkg -list
lists all
currently installed packages. sudo apt-get update
Retrieves information about which updates are
available for currently installed packages from online sources. sudo apt-get upgrade
Installs all available updates for packages currently installed from online sources
. sudo apt-get install
Used to install a package from an online source
. sudo apt-cache search [package name]
Search for packages available from online sources
.
sudo
apt-get remove Uninstalls an installed software package
without purging
settings, plug-ins, and settings. sudo apt-get purge Removes an installed software package,
including its settings, plug-ins, and settings
. sudo apt-get autoremove
Deletes previously installed packages as dependencies that are no longer required for currently installed software
.
File commands
ls ‘ls’ refers to “list
” and is used to enumerate files
and folders within a directory. ls-al
Displays a long list of files and folders within a
directory. CD ‘cd’ stands for “change
directory” and is used to change
the working directory in which you are operating. cd dir Changes the directory
to a specific location in your storage
. pwd ‘
pwd
‘ stands for “Print Work Directory” and provides you with the full name of the path of the current working directory. mkdir [dir] ‘mkdir’ stands for ”
Make Directory” and using the command ‘mkdir dir’ create a directory instead of “dir” according to the name used, in the working directory.
rm [file] ‘rm’ stands for “Delete” and
executes the deletion of the specified file
. rm -r dir ‘-r’ refers to “Recursive Mode” and deletes a directory and all its contents. rm -f [file] ‘-
f’ stands for “Forced” and forcibly deletes a file regardless of its permissions
. rm -rf [dir] Removes a
directory and all of its contents, regardless of individual file permissions
. cp [file1] [file2] ‘cp’ refers to “Copy” and using this command copies a file to a file of a different name, leaving the original intact and creating a new file. mv [file1] [file2]
‘mv
‘ refers to “Move” and using this command moves a file to a file of a different name
(and place if specified), The original is not preserved, but is literally moved to the new file name and location.
Ubuntu Shortcut Keys Key
SUPER (Windows button)CTRL + ALT + T SUPER + L or CTRL + ALT + L SUPER + D or CTRL + ALT +D SUPER +A SUPER + TAB SUPER + SUPER