Linux Commands

Series: Linux For Newbies

Working from the command line may seem to be a challenge when you’re used to working from a GUI (Graphical User Interface). In essence, everything that happens when you click an icon or option in a GUI corresponds to a command that can be run from the terminal.

In Linux, the command line is quite powerful as you are in direct control of anything that takes place, without the need for said command to be run by clicking on an icon. Desktop environments are still quite useful, but if you are ever working in a server environment, it’s essentially an unnecessary option.

Linux commands are all text based, and generally a combination of a word or phrase followed by some options.

For example, the ls command will “list” the files in a given directory. Here’s the list of the home directory in my Nextcloud server:

mjp@cloud:~$ ls
nextcloud_install_production.sh

Here’s the same listing with additional options for ls, using the -lah flags. The -l flag lists things in long format, -a shows all files, including hidden ones, and -h adds human readable format:

mjp@cloud:~$ ls -lah
total 80K
drwxr-xr-x 5 mjp  mjp  4.0K Dec 22 00:21 .
drwxr-xr-x 4 root root 4.0K Mar 13  2022 ..
-rw------- 1 mjp  mjp  8.4K Mar 16 13:03 .bash_history
-rw-r--r-- 1 mjp  mjp   220 Mar 13  2022 .bash_logout
-rw-r--r-- 1 mjp  mjp  3.8K Jun 22  2022 .bashrc
drwx------ 2 mjp  mjp  4.0K Mar 13  2022 .cache
drwxrwxr-x 3 mjp  mjp  4.0K Dec 22 00:21 .local
-rw-rw-r-- 1 mjp  mjp   29K Mar 13  2022 nextcloud_install_production.sh
-rw-r--r-- 1 mjp  mjp   807 Mar 13  2022 .profile
drwx------ 2 mjp  mjp  4.0K Dec 22 00:21 .ssh
-rw-r--r-- 1 mjp  mjp     0 Mar 13  2022 .sudo_as_admin_successful
-rw-rw-r-- 1 mjp  mjp   165 Mar 13  2022 .wget-hsts

Dont worry if all of this doesn’t make a ton of sense all at once. Spend time familiarizing yourself with the terminal to learn the relationship between the commands you type and the output you see. Learn how to read those results and understand the results of any actions you’ve taken.

There are tons of great beginner guides online that will help you along the way. One of the sources that I found to be quite useful early on was from a Youtube channel called LearnLinuxTV. The host, Jay, has a number of video series dedicated to different levels of Linux Users, and a ton of great guides for beginners.