Ubuntu has seen one of the best releases in the last few years with version 20.04 and 20.04 LTS and it’s bringing new users to the platform. For that reason we prepared a quick guide to show you some of the important command line tools that are available in Ubuntu as well as other Debian based distros.
You can use this post as an Ubuntu CLI cheat sheet if you like, as we will be adding new commands regularly.
Let’s start with one of the most popular commands:
sudo is the quickest way to run something as a super user on a Linux environment. In this guide you will see that many commands must be run using
sudo and the reason is that some of these commands can only be run as an administrator (or root user in the Linux world).
sudo apt install <package> will install a package as a super user.
sudo su Will open a shell as
root. If you are looking to perform many ROOT level tasks, perhaps switching to the root user is a good idea.
sudo !! Useful to run the last command but now as root. If you wrote a long command but you forgot to run it as root this is a quick way to rerun it.
apt is one of the most popular cli tools available. It’s a system package manager that can keep the OS up to date and allows users to find and install new software. This can be considered the most important command line tool in Debian based systems.
Some of the most important commands are the following:
sudo apt update - Will update the manifest of all packages to learn if there are updates available.
sudo apt upgrade - Upgrades all packages installed in the system to their latest versions.
apt search <name> - Searches for packages containing the word provided under
ivan@ubuntu:~$ apt search tilix
Snap is a software deployment and package manager built by Canonical, the same company behind Ubuntu. You can install Snap on Debian distros by running
sudo apt install snapd. Once installed you can use Snap in a similar way than Apt.
snap find <name> - Will look for packages that match the name field.
sudo snap install <name> - Will install the provided package.
sudo snap refresh - Will update installed packages.
sudo snap refresh --list
Aptitude is an Ncurses based UI for installing packages on a Debian based system. Think about this as the console GUI for
apt. It can be installed by running
sudo apt install aptitude and the commands are very similar to the ones in apt.
aptitude will launch Aptitude GUI.
aptitude install <name> will install a package.
aptitude search emacs will search for a package.
UFW is the tool for managing Ubuntu’s firewall.
sudo ufw deny from 18.104.22.168 Will block connections from the specified IP
sudo ufw allow 443 Will allow connections to the system on port 443 (https)
sudo ufw status Will show the current status (enabled|disabled)
Htop is a console visual representation of the system monitor. It shows processes running as well as memory, cpu and disk usage. It can be customized and sorted in many ways and it’s normally one of the first utilities installed by power users.
Midnight Commander is a visual file manager for the console and it’s based on Ncurses (like Aptitude). Installing it is as simple as doing
sudo apt install mc.
The interface will show two panels where you can move/copy files from and to as well as many other fuctions. Definitely a great tool if you have no access to a desktop environment.
More to come
Keep an eye on this guide as we will be adding more commands to help new users get familiar with the console and CLI tools.
- Update Ubuntu from LTS to 19.04
In this guide we show you how to upgrade from Ubuntu LTS to 19.04