Introduction

If you have ever used a website, a smartphone, or a streaming service, you have almost certainly used Linux without knowing it. Linux is a free, open-source operating system that runs most of the world’s web servers, the cloud platforms behind our favourite apps, Android phones, routers, and even the fastest supercomputers. It matters because it is stable, secure, and flexible: anyone can inspect its code and shape it to fit a job, which is why it has become the backbone of modern IT.

Before actually starting out with Linux, I will admit the Linux terminal scared me. I was used to clicking icons and dragging files around, and a black screen with a blinking cursor felt like a place where one wrong word could break everything. I assumed the command line was reserved for “real” system administrators, and that I would spend more time memorising strange abbreviations than getting anything done. Working through the Basic Linux Commands changed that view. In this post, I walk you through the commands I learned, how they are used in real jobs, the challenges I faced, and how I plan to keep improving.

So, What Is a Command?

A command is simply an instruction you type to tell the computer what to do. Instead of double-clicking a folder to open it, you type a short word such as ls and press Enter. The terminal (also called the command line or shell) reads that instruction, runs it, and prints the result.

Most commands follow the same pattern: the command itself, optional options (also called flags) that change how it behaves, and arguments that say what to act on. In ls -l /home, ls is the command, -l is the option, and /home is the argument.

Terminal running echo "Hello Linux", which prints Hello Linux, then date, which prints the current date and time

Running echo and date: your first commands and their output.

Terminal showing ls -l /home with the command, the -l option and the /home argument each boxed and numbered 1 to 3

Anatomy of a command: the command, its option and its argument.

Once I understood this pattern, every new command felt less like a foreign word and more like a variation of something I already knew.

How We Will Explore the Commands

There are hundreds of Linux commands, so learning them as one long list would be overwhelming. To keep things manageable, I group the ones from this module into five categories:

  1. File System Navigation Commands: ls, cd, pwd, mkdir, rm
  2. File Management Commands: cp, mv, touch, cat, grep
  3. User & Permissions Commands: sudo, usermod, chmod, chown
  4. Process Management Commands: ps, kill, top
  5. Package Management Commands: apt, yum, dnf

For each category, I first explain the idea behind it, then walk through its commands with examples.

1. File System Navigation Commands

The file system is how Linux organises everything stored on a computer. It is laid out as a tree that starts at a single root directory, written /, and navigation simply means moving around that tree and knowing where you are.

One idea made everything click for me: in Linux, everything is a file. Documents and images are files, of course, but so are directories (special files that list other files), hardware devices such as your keyboard or hard drive (found under /dev), and even information about running programs (found under /proc). Because everything is treated the same way, the same handful of commands works almost everywhere.

Diagram of the Linux directory tree: the root / branching into /home, /etc, /var, /dev and /proc, with the note "Everything is a file"

The Linux directory tree. Everything below / is a file.

  • pwd (print working directory) shows the directory you are in right now.
  • ls lists what is inside a directory. ls -la also shows hidden files plus details such as size and permissions.
  • cd changes directory. cd /var/log jumps there, cd .. goes up one level, and cd ~ returns to your home directory.
  • mkdir projects creates a new directory called projects.
  • rm notes.txt deletes a file, and rm -r old-folder deletes a directory and everything inside it.

Terminal session running pwd, ls, mkdir projects, cd projects and pwd again, ending inside the projects directory

Moving around with pwd, ls, mkdir and cd.

A word of warning about rm: Linux has no recycle bin, so deleted files are gone for good.

Terminal creating test.txt with touch, listing it with ls, deleting it with rm, and ls no longer showing it

rm deletes immediately, with no confirmation and no undo.

2. File Management Commands

File management means creating, copying, moving, renaming, reading and searching the files themselves. In a graphical interface you would do this with right-click menus and drag and drop. In the terminal, a few short commands do the same work, and they are fast and easy to automate.

  • touch notes.txt creates an empty file (or updates the timestamp of an existing one).
  • cp notes.txt backup.txt copies a file, and cp -r copies a whole directory.
  • mv notes.txt documents/ moves a file, while mv old.txt new.txt renames it.
  • cat notes.txt prints a file’s contents on the screen.
  • grep "error" server.log searches a file and shows only the lines that contain the word “error.”

Terminal session using touch, cp, mv and cat, with ls after each step showing notes.txt, backup.txt and archive.txt

Creating, copying, moving and reading files with touch, cp, mv and cat.

grep "error" server.log printing only the two log lines that contain the word error

grep shows only the lines that contain “error.”

3. User & Permissions Commands

A user is an account that can log in to and use the system. Every person, and many programs, run as a user, and users can be placed into groups. Linux is a multi-user system, so many people can share one machine at the same time.

Permissions exist to keep that sharing safe. They control who can read, write or execute each file, so one user cannot read another’s private data or break files that do not belong to them. A special account called root can do anything, which is why powerful actions are protected behind extra steps.

  • sudo runs a single command with administrator privileges, for example sudo apt update. Use it only when you truly need it.
  • usermod modifies a user account. sudo usermod -aG docker alice adds the user alice to the docker group.
  • chmod changes permissions. chmod 755 script.sh gives the owner full access and everyone else read and execute. The numbers add up: read = 4, write = 2, execute = 1, so 7 = 4+2+1 and 5 = 4+1.
  • chown changes ownership. sudo chown alice:developers report.txt makes alice the owner and developers the group.

Terminal running sudo usermod -aG developers testuser, then groups testuser listing testuser and developers

Adding a user to a group with usermod, then confirming with groups.

ls -l output for script.sh with the permission string -rwxr-xr-- split into file type, owner, group and others

Reading the permission string in ls -l output.

Graphic showing chmod 755: owner, group and others each built from read 4, write 2 and execute 1, adding up to 7, 5 and 5

How chmod 755 is built from 4, 2 and 1.

4. Process Management Commands

A process is a program that is currently running. When you open a browser or start a web server, Linux creates a process for it and gives it a unique number called a process ID, or PID. Process management is about seeing what is running, how much CPU and memory each process uses, and stopping the ones that misbehave.

  • ps aux gives a snapshot of every running process, including its owner and PID.
  • top shows a live, constantly updating view of CPU and memory usage. Press q to quit.
  • kill <PID> asks a process to stop politely, and kill -9 <PID> forces it to stop as a last resort.

The top screen with the load average, PID, %CPU, %MEM and COMMAND columns labelled
The top screen, labelled.

ps aux output with the USER, PID, %CPU, %MEM and COMMAND columns labelled

The columns of ps aux, labelled.

Terminal starting a background process with sleep 300 &, listing it with ps, stopping it with kill, and ps no longer showing it
Starting a background process, stopping it with kill and checking with ps.

5. Package Management Commands

A package is a bundle that contains a piece of software together with the information needed to install it, such as its version and the other packages it depends on. Package management is the practice of installing, updating and removing those bundles with a tool called a package manager, instead of downloading installers from random websites. It resolves dependencies automatically, pulls software from trusted repositories, and lets you update everything with a single command.

  • apt is used on Debian and Ubuntu. sudo apt update refreshes the list of available software, sudo apt install nginx installs a package, and sudo apt remove nginx removes it.
  • yum is the traditional tool on Red Hat-family systems such as CentOS and RHEL, for example sudo yum install httpd.
  • dnf is the modern successor to yum on Fedora and newer RHEL releases, with the same style of command: sudo dnf install httpd.

Cheat sheet comparing apt, yum and dnf with their update, install and remove commands

Package managers at a glance.

Real-World Application

These basic commands are the daily toolkit of many technology careers. In system administration, admins use ps, top, and grep to diagnose slow servers and read logs, useradd and usermod to manage accounts, and apt or dnf to patch software on schedule.

In cybersecurity, permissions are central. Using chmod and chown correctly enforces the principle of least privilege, so that sensitive files are not readable by everyone. Analysts also use grep to search authentication logs for suspicious login attempts, and ps to spot unexpected processes that might signal malware.

In DevOps, almost every automation script, CI/CD pipeline, and Docker container relies on these same commands. A deployment script might create directories with mkdir, copy build files with cp, set execute permissions with chmod, and restart a service after installing packages.

In cloud computing, most virtual machines on platforms like AWS, Azure, and Google Cloud run Linux and are managed over SSH, where there is no graphical interface at all. Being comfortable in the terminal is therefore not optional; it is the main way to configure and troubleshoot cloud servers.

Challenges & Takeaways

My biggest challenge was simply remembering the syntax and the many options. Commands such as chmod with numeric modes felt like a secret code at first, and I often mixed up the order of arguments in cp and mv. I also felt nervous using sudo and rm, since mistakes in the terminal are not always reversible. Another surprise was that package managers differ between distributions, so a command that worked on Ubuntu failed on a Red Hat-based system.

What helped was practising in a safe test environment, reading error messages carefully instead of panicking, and using man pages and the --help flag when I was stuck.

The most useful command for me was grep. Being able to search a large file for one word in a split second felt like a superpower, and it made me understand why administrators love the command line. The most exciting moment was seeing top update live and realising I could control what a computer was doing in real time.

Conclusion

Learning these commands took me from fearing the terminal to feeling curious and confident in it. I now understand how to navigate the filesystem, manage files, control permissions, monitor processes, and install software, which are the foundations for everything more advanced in Linux.

To keep improving, I plan to practise a little every day by using the terminal for routine tasks instead of the graphical interface. I will set up a Linux virtual machine to experiment safely, learn shell scripting to automate repetitive work, and explore tools like find, ssh, and cron. Eventually, I would like to build a small project, such as hosting a simple web server, to apply everything I have learned.