Mastering Linux Explained Simply (with Diagrams and Real Code)

Mastering Linux: the essentials in one article — real code, diagrams and concrete steps, extracts from a 42-lesson course.

Mastering Linux Explained Simply (with Diagrams and Real Code)

A no-nonsense guide: Mastering Linux broken down with diagrams, concrete examples and tested commands. Everything comes from a structured 11-chapter course — here are the best parts.

tl;dr
  • Introduction and Installation
  • File System and Navigation
  • Permissions and Users
  • Text Manipulation and Pipes
  • Processes and System Management
~$ cat ./parcours.md # Mastering Linux — 10 chapters
01
Introduction and Installation
→ Course presentation and Linux history→ Install Ubuntu in VM or WSL2+ 1 more lessons
02
File System and Navigation
→ FHS Hierarchy — /, /etc, /home, /var→ Navigation — cd, ls, pwd, tree+ 2 more lessons
03
Permissions and Users
→ Users, groups and /etc/passwd→ rwx Permissions — symbolic and octal+ 2 more lessons
04
Text Manipulation and Pipes
→ cat, less, head, tail→ grep and regular expressions+ 2 more lessons
05
Processes and System Management
→ ps, top, htop — view processes→ Signals — kill, SIGTERM, SIGKILL+ 2 more lessons
06
Scripting Bash
→ Variables, quotes and substitution→ if, case, for and while loops+ 2 more lessons
07
Package and Service Management
→ apt and dpkg (Debian/Ubuntu)→ dnf, snap and flatpak+ 2 more lessons
08
Networking and SSH
→ ip, ss, ping, traceroute, dig→ SSH with keys and ~/.ssh/config+ 2 more lessons
🏁
Final project (+ 2 chapters along the way)
→ You leave with a concrete and demonstrable project

Variables, Quotes and Substitution

NOTEObjective — Write your first Bash script, understand variables, master the crucial difference between single and double quotes, and capture a command's output into a variable.

Learning Objectives

TIPBy the end of this module
  • Write and run a script with a shebang
  • Declare and use variables
  • Distinguish single quotes, double quotes and no quotes
  • Capture command output with $(...)
  • Understand environment variables

Your First Script

A Bash script is simply a text file containing commands. The first line, the shebang #!/bin/bash, tells the system which interpreter to use.

FormBehaviorExample
Double "..."Variables are expanded"Hello $name" → Hello Alice
Single '...'Everything is literal, nothing is expanded'Hello $name' → Hello $name
No quotesWord splitting on spaces (dangerous)$file with space = 2 words

Legacy Backticks

The old form `command` still works but nests poorly. Avoid it in new scripts.

Environment Variables

Some variables are shared across the entire system. By convention they are written in UPPERCASE.

sed and awk — Transforming Text

NOTEObjective — Discover the two Swiss Army knives of text processing: sed for substitution and line-by-line editing, and awk for extracting and computing by columns.

Learning Objectives

TIPBy the end of this module
  • Substitute text with sed 's/old/new/'
  • Edit a file in place with sed -i
  • Extract columns with awk '{print $N}'
  • Filter and compute with awk
  • Choose between grep, sed and awk according to the need

sed: The Stream Editor

sed (Stream EDitor) applies a transformation to each line of a stream. Its most common use is substitution with the s/pattern/replacement/ command.

Think "transform"

If you want to modify content (substitution), use sed. If you work with columns, use awk.

Real Combined Example

Navigation — cd, ls, pwd, tree

NOTEObjective — Master everyday navigation commands: move with cd, list with ls and its options, know your location with pwd, and save time with tab completion.

Learning Objectives

TIPBy the end of this module
  • Move efficiently with cd and its shortcuts
  • Read the output of ls -l column by column
  • Show hidden files with ls -a
  • Sort and format the output of ls
  • Use the Tab key for automatic completion

cd: Moving Through the Directory Tree

The cd (change directory) command is the one you will use most often. It accepts an absolute or relative path and several very handy shortcuts.

tree for the Big Picture

tree -L 2 is perfect for documenting or understanding a project's structure at a glance.

Tab Completion: Your Best Friend

You almost never need to type a full filename. Type the first letters then press the Tab key: the shell completes it automatically.

go-further

This article covers the most useful excerpts — the full Mastering Linux course (11 chapters, 42 lessons, corrected exercises and final project) takes you all the way.

./access-the-full-course free course: Mastering Claude Code

FAQ

How long does it take to learn Mastering Linux?
With a structured progression (11 chapters, 42 short practical lessons), you reach an operational level in a few weeks at 30–60 minutes per day. The key is to practice each concept immediately.
Are there any prerequisites?
Basic computer knowledge is enough. If you can use a terminal and read simple code, you are ready.
Where should I start concretely?
Reproduce the commands in this article, then follow the full Mastering Linux course: it chains the 42 lessons in order, with exercises and a final project.

📬 Want to receive this kind of guide every week? Subscribe for free — real code, zero fluff.