When I first started with Linux, I used to mostly rely on the graphical interface simply because it felt familiar and straightforward, especially since I am used to the Windows OS. However, after spending some time, I realized the terminal offers more power and speed. At first, learning even the basic commands was a task, but when I picked up a few essentials, my workflow improved significantly.
Here are a few of the command-line utilities that have improved my productivity on Linux (specifically Ubuntu). None of the following commands is advanced. These are the ones that I actually use during my workflow to get things quickly.
ls and cd: Navigating my system without a mouse
Foundation commands to get around quickly on Linux
The ls and cd commands may seem basic, but I regularly use them to check on my directories directly on the command line. The ls -lah command gives a formatted list of all the folders in a drive with their permissions, sizes, and even displays hidden files. If you want to quickly look for a sub-folder in a directory, this is one helpful command.
The cd command, on the other hand, lets me jump between folders and see their contents, without having to access GUI file manager. If you need to go one level up, use the cd .. command, and if you want to go back to the previous directory, use the cd - command.
du and df: To find out what’s eating up my disk space
My go-to commands to prepare for disk cleanup
If my hard disk runs significantly low and the system feels sluggish, instead of guesswork, I use the df -h command to check the disk usage. It shows the used and available space of your partitions along with the usage percentage, and where they are mounted. The usage percentage will give you the idea of which drive you need to clean.
Then, by using the du -sh * command under any directory, for example, Downloads, you can check what’s hogging the space, and if it isn’t important, you can simply delete it. What makes it different from the file manager is that this command lists the files and folders in the order of the space they are occupying, making it easier for you to spot the space-hogging ones without disturbing your file manager’s view. It is far quicker than right-clicking and checking the Properties one by one.
By running sudo du -sh /* from root, you can find out which directories are hogging space system-wide.
htop: A better way to check CPU and RAM usage
Better than the “top” and easier to understand
When I first started with Linux, I used to rely on top to monitor my CPU and RAM usage. However, I soon discovered htop and then never looked back. I was surprised to see its color-coded, real-time view of system resources and running processes on a command-line tool, without a GUI.
It provides advanced, detailed information on running processes. You can easily sort them by CPU or RAM usage, as well as other factors. You can also kill a process right from the command line through htop.
To install it, use the sudo apt install htop command.
wget: To download files without opening a browser
I have better control over my downloads now
If you want to have better control over your downloads and need to check the status of the server, curl and wget are the best commands for that. With wget, I can download files from the web with a single command. Now, what makes it different from the browser download? I have better control, i.e., I can easily pause my downloads on the terminal itself, close it, and resume the download later on. Also, if my internet connection gets dropped for some reason, my downloads will not be entirely lost. It would swiftly resume without errors once the connection is re-established.
Further, you can also download a particular type of file from a page all at once. For example, the “wget -r -A pdf https://example.com/resources/” command will download all the PDF files from the “example.com/resources” web page. It also lets you download multiple files at once. Simply put 100s of download links in a text file, say “Downloads.txt,” and use the wget -i Downloads.txt command to start downloading those 100s of files.
apt: My all-purpose software installer
Whether to install a third-party app or update my system, this one comes in handy
Apt is my go-to command to download and install applications and packages on Debian-based Linux systems. It’s pretty simple to use, yet a powerful command. Apt is actually to Linux what winget is for Windows.
After freshly installing a Linux system, you can use the apt command to install all your necessary applications like VLC Media Player, GIMP, and more. It’s pretty simple, just use the sudo apt install appname to install the application. For example, sudo apt install gimp will install the GIMP to your system. You just need to know the correct package name to install the app, which you can easily find out on the web.
Further, by using sudo apt update, you can list all the latest updates available to your Linux distros. After that, using sudo apt upgrade will install the new versions of all upgradeable packages.
nano: A simple text editor inside the terminal
For quick notes and edits, nano is just right
Most Linux users are fans of Vim or Emacs, but I love nano for its simplicity. It’s the tool I mostly use for editing system configuration files or writing custom scripts. To open a file, simply use the nano filename.txt command. You can also quickly write a note while using the terminal through nano. Just type nano, and it will open an editor where you can simply take your notes. To save and exit, press Ctrl + X, then Y and Enter.
find: For when I know the file name, but couldn’t find it
Search for the lost files quickly
Find is a lifesaver command in situations when I couldn’t locate a file. I could simply use this command to find the file with its exact name or find all the files of a particular type, say PDF or DOCX. The command scans your current directory and all its sub-folders for the targeted file or file type.
For example, find . -name “*.pdf” command will list out all the PDF files under the targeted folder. You can further use the exec command to delete or move the found files.
The command line isn’t just for developers or “hackers”
It might be intimidating to use the Linux terminal at first, but after a few uses, you’ll be comfortable. You can start with all or a few of these commands. The more you use them, the more comfortable you’ll be with the terminal. You’ll soon notice a significant upgrade to your productivity with these utility commands. As you can see, there’s no major learning curve and all are pretty easy to apply.