How to Learn Linux – A Master Overview Guide

Last updated: April 5, 2023 | Bobbin Zachariah

Learning Linux operating systems is an important skill for various computer science fields. Apart from cybersecurity, Linux knowledge is also beneficial in software development, system administration, data science, and cloud computing, to name a few.

Believe it or not, learning Linux isn't as complicated as you might think. While switching to a new operating system may seem daunting at first, once you get started, you'll find that Linux is quite simple and easy to use.

Using the keyboard and terminal instead of relying solely on the mouse is a great way to get more out of your Linux experience. Although the mouse can be helpful in many situations, mastering the keyboard and terminal can provide you with an unprecedented level of control over your Linux system.

In this tutorial, we'll provide you with an overview of the key concepts, tools, and commands that you'll need to get started with Linux.

1. Installing Linux on Your Computer

As you embark on your journey to learn Linux, one of the first steps is to select and download a distribution ( known as distro) that suits your needs. Options such as Ubuntu, Mint, Arch, elementary, and Pop!_OS are popular choices, all designed with a focus on balancing usability and productivity. While there may be some differences between these distros, they all rely on Linux as their foundation, offering similar levels of compatibility with your computer's hardware.

Linux Distribution List

Creating a Bootable USB Drive:

Now that you've found a preferable distro, download the ISO file from a reputable source - usually the official website of the distribution. After downloading the ISO, create a bootable USB drive using Rufus or Etcher, this way, you'll be able to boot from the USB and install Linux on your computer's hard drive later on. But be warned: You don't want to download anything from a questionable website and end up with malware on your machine.

Installing Linux:

Installing Linux is straightforward! Once you've created your Linux distribution USB, you'll need to change your computer's boot order (from BIOS or UEFI settings) to prioritize USB devices. After you've booted from the USB drive, the Linux distribution's installer will walk you through the installation process, prompting you to select your language, time zone, and partition your hard drive. You'll also be asked to create a username and password for your new Linux installation.

Note: If you already have an operating system that you want to keep, avoid choosing "Erase disk and install {your distro}" during the installation process. This option will wipe everything on your hard drive, including your existing OS.

Using Virtual Machines:

If you don't want to modify your existing operating system or partition your hard drive, you can still install Linux using a virtual machine like VirtualBox or VMware, which are both available for free. Using a virtual machine provides a safe and isolated environment to learn Linux and experiment with different distributions without affecting your main system.

How to Install Debian on VirtualBox (with Screenshots)

How to Install Linux – Beginners Guide

2. Understanding the Linux File System

As you go forward with your Linux learning journey, it's important to grasp the essential role of file systems in managing data. Linux offers can use multiple file systems, including Ext, Ext2, Ext3, Ext4, JFS, ReiserFS, XFS, btrfs, and swap. These file systems are responsible for managing data storage and retrieval, including the organization of files and directories.

If you want to format a partition, you should consider selecting the appropriate file system that suits your needs.

  • ext4 is the default option and provides speed and stability among other ext file systems.
  • JFS and XFS can be great options for working with large files or databases.
  • ReiserFS is well suited for efficient storage and fast search capabilities.
  • Swap expands the available memory for a system to run more processes and programs.

The Linux file system is like a library for your computer, it contains directories, files, and also metadata. Directories are used to organize files, while files store data such as text, images, and programs. Metadata includes information about both files and directories such as permissions, ownership, and creation/modification timestamps.

In Linux understanding different file systems is just the beginning - it's also important to know that a disk is a physical device to store data, while a partition is a logical section of that disk. Meaning you can create multiple partitions on any disk, each with its unique file system and mount point, using a partition management tool called fdisk. For instance, you might create one partition for the operating system, another for user data, and a third for backup files - not only that you can also delete existing partitions, or modify their attributes.

3. Directory  Structure

In Linux, you'll find that the directory structure is organized in a hierarchical tree-like form with the root directory (/) as the uppermost directory. In-depth, if you see a visualization of the whole directory design, you'll notice multiple files and sub-directories nested within the root directory. Moreover, some of these sub-directories can even have their own sub-directories, and so on.

While it's not absolutely necessary to be familiar with all of the essential directories in Linux, having a basic understanding of some key directories and their purposes can be helpful in gaining a better understanding of the system:

  • / (Root): contains all the files and directories, which support the proper functioning of the system.
  • /bin: contains essential command binaries required to boot the system and run processes.
  • /dev: contains device files representing hardware devices and other peripherals connected to the system.
  • /etc: contains system configuration files that control the behavior of various system components.
  • /home: contains user-specific data and configuration files for each user.
  • /lib: contains shared library files required by the system and its processes.
  • /opt: contains optional files installed on the system, such as third-party commands.
  • /tmp: contains temporary files created by the system and applications.
  • /usr: contains user-related programs, libraries, man files, and other data.
  • /var: contains variable data, such as log files, email, corn files, and system backups.

4. Getting Started with Linux Commands

Before you actually start to tinker with your Linux machine; you'll need to get acquainted with some basic tools that will come in handy for your daily Linux operations. These are both basic and frequently used, making them useful for beginners and professionals alike:

cd (change directory) - This command is used to change the current working directory. For example, if you're in your home directory and want to navigate to the "Documents" folder, you can type:

$ cd Documents

Conversely, if you want to return to your previous directory, you can simply type:

$ cd ..

ls (list) - This command is used to list the contents of the current directory. For example, typing ls and hitting enter, will display a list of all the files and directories in the current directory:

$ ls
Videos/  Documents/  Downloads/  book.pdf

Using the ls command is usually executed before running the cd command to see your target location before you hop onto it.

mkdir (make directory) - This command is used to create a new directory. For example, if you want to create a directory called "Pictures", you can type:

$ mkdir Pictures

You can make sure that your new directory is created by using the cd command to navigate into it, or simply list the content of the current directory with ls.

rm (remove) - This command is used to remove files and directories. For example, let's delete a file called book.pdf:

$ rm book.pdf

Having seen that, to delete a directory and its content, you should add the -r flag to the command for a recursive effect:

$ rm -r Videos

cat (concatenate) - This command is used to display the contents of a file. For example, if you have a text file called "myNotes.txt" and you want to view it in your terminal, you can simply type:

$ cat myNotes.txt

These examples only scratch the surface of what these commands can do. With time/practice, you'll explore more advanced techniques and creative ways to use them.

13 Modern Alternatives to Linux Commands

Linux Commands Cheat Sheet

5. Understanding Desktop environments

If this is the first time you've installed Linux, you know by now that the process of getting this OS differs from buying a Windows or Apple's macOS. When looking for Linux, you won't find a single download option on one official website - this OS gives you more control.

Before downloading Linux, you don't only have to choose a distro that best suits your needs, you'll also get overwhelmed with a multitude of choices selecting a desktop environment (for graphics-based experience) that aligns with your preferences and aesthetics. Some of the most popular desktop environments include GNOME, KDE, XFCE, and Cinnamon.

Alright, so you know what a Linux distro is, right? It's the software that makes your computer work. Well, a desktop environment is like the fancy outfit your distro puts on to look good for you. It's a bunch of tools and pieces that help you interact with your computer, all dressed up with colors, icons, menus, and widgets.

Some of the pieces that identify a desktop environment are, a window manager (can re-size and reposition windows), icons, windows, folders, wallpapers, panels, menus, file manager (can explore stored files), and last but not least, the display manager (provides a graphical login). Ultimately, You need all these pieces to navigate your system while also getting an enjoyable graphical experience.

6. Getting started With File Editing

With Linux, there are various tools to view and edit text files. If you want to only print the content of a text file to your command-line interface, one of the most commonly used commands is cat, which allows you to view the contents of a file from your terminal. Other useful commands include the less and more commands, which are meant for viewing long files page by page.

When it comes to editing, the most common method is to use a text editor, such as vi, nano, or gedit (GUI). Each of these editors has its own advantages and disadvantages, and you should try them out so you can choose the one that suits your needs. Alternatively, you may also use more advanced command utilities like sed and awk to edit files programmatically.

During your Linux journey, you'll hear more about advanced editors such as Vim, Neovim, and Emacs. These Editors are by far both the most complex and fun to use; even though they have a steeper learning curve compared to nano or gedit, they are very customizable (syntax highlighting, auto-formatting...). Additionally, these editors come with a plethora of plugins and add-ons that boost the coding experience for programmers and system administrators alike.

7. Managing Users

Managing users in Linux is mostly related to sys admins, however, even Linux beginners and hobbyists should learn the basics of this topic.

One of the landmarks of managing users is getting acquainted with the /etc/passwd file (you can use cat to view it), which stores user account information such as the UID, account name, home directory, and default shell. Similarly, the /etc/shadow file - is only accessible to root and - stores encrypted user passwords and password expiration information.

You can manage user accounts with intuitive commands such as useradd, usermod, and userdel. For instance, you may add a new user called "bouhannana" with useradd:

$ sudo useradd bouhannana

Subsequently, you'll have to pair a new password to the new user with the passwd command:

$ sudo passwd bouhannana

After executing the above command, you'll be prompted to enter and re-enter the password to confirm it. And Voila! a new user is added.

You can also use the usermod command with the same simplicity to modify a user's attributes, such as their name, group, home directory, and more. But if you decide to delete a user, executing the userdel command will remove both the user's information and its home directory.

Similarly with managing groups, you can check all your system's group account information in the /etc/group file. And as forthcoming as the previous commands, you can:

  • Create new groups with groupadd
  • Modify existing groups with groupmod
  • Delete existing groups with groupdel

8. Permissions in Linux

Understanding permissions are critical for your Linux security and integrity, and knowing how to manage them will help you control who can do what with your files and directories.

There are three types of permissions: read, write, and execute. The read permission allows you to see what's in a file/directory, the write permission allows you to change what's in a file/directory, and the execute permission lets you run a file/script.

To set permissions for a file or a directory, you can use the chmod command coupled with a series of alphanumeric characters or octal numbers (ranging from 0 to 7), to represent the permissions. How? For instance: The read permission is represented by "r" or "4", the write permission is represented by "w" or "2", and the execute permission is represented by "x" or "1".

Let's check the command in action:

$ chmod u=rw,g=r,o=r bouhannana.txt

The above command sets read and write permissions to the bouhannana.txt file. These are read and write for the user (u), read for groups (g), and read for others (o). You can apply the same permissions by using numbers rather than characters:

$ chmod 644 bouhannana.txt

Our file still has the same permissions as before, the numbers 6, 4, and 4 are the permissions for the user, group, and other, respectively; 6 (4+2) indicates read (represented by 4) and write (represented by 2) permissions for users , and 4 indicates read permission for users and others.

Moreover, the chown and chgrp commands will allow you to change the owners and groups for a file or a directory, respectively. Simply type the command, the name of the new user or group, and then the target file:

$ chown newuser bouhannana.txt
$ chgrp newgroup bouhannana.txt

Linux File Permissions Explained: A Practical Approach

9. Configuring Linux Networking

In the vast universe of Linux, configuring its networking can feel like a daunting task using the terminal. But fear not - you have a choice to cozy up to GUI tools such as NetworkManager or Wicd.

These tools make managing and configuring network connections a breeze - such as IP addresses, DNS servers, and network interfaces, among other things -, all through a user-friendly graphical interface. Ultimately, you can have access to NetworkManager on most Linux distributions, by easily accessing the system settings or network icon in the taskbar.

When it comes to configuring networking on your Linux system, the command line is an efficient alternative to the GUI. Through common commands such as ip, ifconfig, route, and ping, you can assign IP addresses, configure network routes, and modify network interfaces with ease. While the GUI may be a more familiar option for some, the command line can offer a faster and more customizable experience for those willing to learn its ins and outs.

Among these networking commands, ifconfig is by far the most common one. However, in recent years, a new alternative called ip has emerged, offering broader functionalities and features. Therefore, if you're moving on to learn the ins and outs of Linux basic networking, it's recommended to learn ip instead of the old ifconfig.

10. Installing and Managing Software in Linux

Linux offers different package managers to manage software installation, configuration, update, and removal in a convenient way. The package manager provides a simple and standardized way to install software from a central repository, handle dependencies, and update software to the latest version. Two of the most popular package managers are APT (Advanced Package Tool) for Debian and its derivatives like Ubuntu, and DNF (Dandified YUM) - which is the improved version of YUM (Yellowdog Updater Modified) - for Red Hat, CentOS, and Fedora.

You can use APT, if you have a Debian-based distro to manage your software packages from the command line. With this tool you have various options that can be customized, such as specifying the package version to install, purging configuration files, or pinning a package to prevent updates.

If you're using a Red Hat-based distro, you may rely on DNF, which also has similar functionalities. These include resolving dependencies, managing package groups, and enabling or disabling repositories. Conversely, with DNF you can install packages that you've separately downloaded from the web.

But if you opt for any Arch-based distro, you'll probably rely on Pacman. This package manager doesn't use sub-commands such as install, update, or remove, but rather a single letter flag for most of its functionalities. For instance, you may use the -S option for installing, updating, and searching for a package.

What is a Package Manager in Linux

How to Install Software on Linux – Beginners Guide

11. Searching Linux’s Content

Searching for files and their content is a piece of cake with Linux. With the find command, you can easily search for files and directories based on various criteria such as name, size, and modification time. On the other hand, grep command allows you to search for string patterns or specific strings in the contents of files.

If you're looking for a specific file or set of files on your Linux system, the find command is an incredibly useful tool. With find, you can easily search through a directory hierarchy based on various criteria like file name, type, size, and more. For instance, if you want to find all .txt files in your home directory and its subdirectories, simply run the command find ~ -name "*.txt" and watch as find does the heavy lifting for you. This command will search your home directory (~) and print the paths of all files with the .txt extension that it finds.

If you want to take your file-searching skills to the next level, then you need to know about the grep command. With this powerful tool, you can search for specific strings or patterns in files and uncover hidden insights. For example, you can easily find all occurrences of the word "error" in a log file by typing grep error /bouhannana/syslog. This will show you every line in the syslog file that contains the word "error".

But that's not all! With regular expressions, you can perform even more complex searches. Try using grep 'error\|warning' /bouhannana/syslog to find lines that contain either "error" or "warning". The possibilities are endless with grep.

12. Pipes and redirections

Pipes and redirections are one of the most important Linux shell operators that give the Linux command line its flexibility and the possibility to still exist after all these years.

Both pipes and redirections are two powerful features of Linux that enable communication between processes. With Pipes, they allow data to be sent from the output of one program to the input of another, but with redirections, they allow data to be sent to or received from a file. Ultimately, both mechanisms consist of two file descriptors, one for reading and the other for writing.

Moreover, It's important to understand stdin and stdout so you can use both pipes and redirections operators effectively: Every time you type a command at a prompt and hit Enter, you're feeding data on stdin. Conversely, every time you execute a command that prints results, these results appear on stdout. With this understanding, you can connect the output of one side to the input of another using redirection operators.

To use Pipes, simply separate multiple commands with the pipe control operator |. The output of the first command is sent to the input of the second command, and so on. This allows for the chaining of commands to perform more complex operations (command1 | command2 |… commandN).

On the other hand, redirections employ the < and > symbols to steer input and output to and from files. So, to redirect a data stream, you can use either the < symbol to transmit the contents of a file to a program as input, or the > symbol to transfer the output of a program to a file as input. Keep in mind that > will overwrite the target file, you can avoid that and use the >> symbol to append output to it.

13. Security

Linux is a fortress of security! This operating system is famously resistant to malware, like viruses and worms. In fact, it's so secure that you'll rarely see antivirus software for sale for Linux. That's because it's naturally resistant to attacks, thanks to its architecture, design, and open-source nature. But with all that, Linux is not an exception to security threats, and you should be aware of how you can maintain its high security.

One of the common ways to maintain your security is to keep your system up-to-date. As mentioned before, you can regularly update your system by relying on the package manager (APT, DNF, or Pacman) of your distribution. For instance, you may update the system using the apt package manager as so:

$ sudo apt update && sudo apt upgrade

The command updates the package sources list to obtain the latest list of available packages in the repositories and upgrades all currently installed packages on your system.

Another important security feature in Linux is SELinux (short for Security-Enhanced Linux) module. What's that? Well, it's basically a set of security modules at the kernel-level that can help protect your system from critical types of vulnerabilities. Moreover, with it, you can define a security context for each file, directory, and process on your system, and then enforce rules that specify which contexts can access which resources. If you want to check the status of your SELinux, you can run the sestatus command in your terminal.

Keep in mind that SELinux is mainly implemented by enterprise-grade entities, rather than individual users.

Moreover, a firewall is an important security feature that allows you to control which network connections are allowed to access your system. Luckily for you, most Linux distributions come with various pre-installed tools to manage firewall rules, like firewalld, iptables, or ufw for something even easier to use. If you want to check the status of your firewalls and the rules currently applied to it - run "ufw status" in your terminal.

15. Scripting

When you start using Linux, it's inevitable to learn scripting to automate your habitual tasks. Why? Because as an everyday Linux user (hobbyist or sys admin), you'll benefit from creating automation scripts by not manually repeating tedious and time-consuming tasks every day. For example, you can automate repetitive actions such as backups, system maintenance, user management, or simply clearing directories that get populated over time.

And that's not all, you can also create scripts to customize your Linux system to your specific needs - For instance, you can set up a custom terminal environment (e.g. syntax highlighting), configure system services, manage password expiration, and monitor system resources (e.g. disk usage) more swiftly and easily. All while reducing the risk of downtime.

There are plenty of scripting languages to get you started, each with its own unique features and syntax that cater to the shifting needs and also preferences of the user. For instance, bash (default in most distros) offers a modest set of features for shell scripting, while zsh is capability-rich and offers some advanced perks such as extended globbing. You can also opt for other shells, like csh, ksh, fish, or more. Besides shell scripting, you'll probably deal with massive outputs and files that will be challenging for your human capabilities to analyze and edit. So, to save your energy, you can manipulate large sets of text-based data and generate custom results with a nifty tool called awk. Under the Linux umbrella, you'll be able to use this tool for creating programs to search and manipulate strings based on patterns, perform calculations, and format output to generate reports in a variety of ways.

50 Bash Script Examples to Kickstart Your Learning


In conclusion, learning Linux may seem like a daunting task at first glance, but once you get a hang of it, it becomes much simpler. In this article, we've provided you with the main points for each subtopic - this serves as a boost or an appetizer to start your journey.

Don't forget that the secret to mastering Linux is to put in some elbow grease and spend time honing your skills. That's it! you'll feel more and more at ease with the Linux environment. So get your command-line toolbox and dive headfirst into the world of Linux. Who knows what you might accomplish?



Please add comments below to provide the author your ideas, appreciation and feedback.

Leave a Reply

Leave a Comment