$
Learn Linux handbook
en
XP:0

The BashQuest learning library

Understand Linux.
Then make it work.

Build the mental model, practice in the terminal, and prove your skills on a real system. Follow a connected path from your first command to everyday Linux operations.

17 chapters150 quests5 real-system labs

A path you can follow.

New to Linux? Start with chapters 1–4 and their quests, then set up a disposable machine. Already use the terminal? Find gaps with the knowledge checks, then try the Boss Challenges. Preparing for operations work? Complete the real-system labs and keep your verification notes.

Read → predict the result → run the command → explain the result without hints. Revisit a completed module after a day and again after a week.

01 / Build understanding

Your Linux handbook.

17 chapters

01 / Foundation

Understand your Linux system

Build a mental model of the kernel, distribution, terminal, shell, and filesystem before memorizing commands.

11 questsConcepts + knowledge check ↗

02 / Foundation

Work safely with files

Create, copy, rename, remove, and link files while understanding what each operation changes.

12 questsConcepts + knowledge check ↗

03 / Foundation

Compose tools with streams

Use standard input, standard output, and pipelines to turn small commands into useful workflows.

7 questsConcepts + knowledge check ↗

05 / Administration

Administer a distribution

Use privilege and package managers deliberately, with a recovery plan.

9 questsConcepts + knowledge check ↗

06 / Administration

Diagnose storage and memory

Distinguish capacity, filesystem usage, mounts, memory pressure, and device layout.

10 questsConcepts + knowledge check ↗

07 / Administration

Understand processes and signals

Find the right process, inspect it, and choose a proportionate intervention.

10 questsConcepts + knowledge check ↗

09 / Administration

Find evidence efficiently

Choose between a live filesystem search, a cached index, and searching inside files.

7 questsConcepts + knowledge check ↗

10 / Administration

Operate services and read logs

Understand running state, startup policy, logs, and the boot sequence.

5 questsConcepts + knowledge check ↗

12 / Automation

Write predictable Bash scripts

Move from command sequences to programs with inputs, decisions, and observable failures.

10 questsConcepts + knowledge check ↗

13 / Automation

Transform structured text

Choose a tool that understands the input structure and validate the output.

7 questsConcepts + knowledge check ↗

14 / Automation

Manage your shell environment

Understand variable scope, startup files, command lookup, and reproducibility.

7 questsConcepts + knowledge check ↗

17 / Operations

Deliver and troubleshoot changes

Combine version control, containers, and operational checks without confusing them with isolation guarantees.

5 questsConcepts + knowledge check ↗

02 / Find your next exercise

Quest & command reference.

Search quests by title, command, or objective. Each reference includes an explanation and a direct terminal launch.

150 quests

01Who Am I and Where Am I?Read & practice →02Navigating & Listing FilesRead & practice →03Listing Detailed InformationRead & practice →04Creating DirectoriesRead & practice →05Nested Directories & OptionsRead & practice →06Visualizing Directory Trees (tree)Read & practice →07Linux Directory Structure & FHSRead & practice →08Inspecting File Types & Metadata (file & stat)Read & practice →09Clearing the ScreenRead & practice →10Finding Shell HelpRead & practice →11Boss Challenge 1: The Wiped Project TreeRead & practice →12Creating Empty FilesRead & practice →13Reading File ContentsRead & practice →14Peeking at Files (head & tail)Read & practice →15Paging Through Large FilesRead & practice →16Handling Spaces in File NamesRead & practice →17Writing & Overwriting FilesRead & practice →18Appending to FilesRead & practice →19Copying & Moving FilesRead & practice →20Wildcards & Multi-File OperationsRead & practice →21Removing Files & FoldersRead & practice →22Brace Expansion & Safe Directory Removal ({} & rmdir)Read & practice →23Boss Challenge 2: Broken Deployment CleanupRead & practice →24Introduction to Pipes & wcRead & practice →25Sorting and Finding UniquesRead & practice →26Filtering with grepRead & practice →27Splitting Output with teeRead & practice →28Comparing Files with diffRead & practice →29Advanced grep Flags (-i, -v, -r, -E)Read & practice →30Boss Challenge 3: Security Incident Log TriageRead & practice →31Changing File PermissionsRead & practice →32Hidden Files & ConfigurationsRead & practice →33Changing File OwnershipRead & practice →34Linux Firewalls (ufw & iptables)Read & practice →35Standard Error & /dev/null (2>, 2>&1)Read & practice →36Multi-Line Input with Here-Docs (<<EOF)Read & practice →37Default Permissions & Group Ownership (umask & chgrp)Read & practice →38Special Permissions (SUID, SGID & Sticky Bit)Read & practice →39Access Control Lists (getfacl & setfacl)Read & practice →40Boss Challenge 4: Security Audit & Permissions LockdownRead & practice →41Superuser Privileges (sudo)Read & practice →42Package Management (apt)Read & practice →43Searching Packages (apt search)Read & practice →44Purging Packages (apt purge)Read & practice →45Debian Package Management (dpkg)Read & practice →46RedHat Package Managers (yum & dnf)Read & practice →47Updating vs. Upgrading (apt update & apt upgrade)Read & practice →48Universal & RPM Packages (rpm & snap)Read & practice →49Boss Challenge 5: Package Hygiene & Malware PurgeRead & practice →50Checking Disk Space (df)Read & practice →51Finding Directory Sizes (du)Read & practice →52Checking Memory Usage (free)Read & practice →53System Uptime & Kernel DetailsRead & practice →54Viewing CPU Details (lscpu)Read & practice →55I/O & CPU Stats (iostat)Read & practice →56Block Devices & Partitions (lsblk & blkid)Read & practice →57Mounting Filesystems (mount, umount & /etc/fstab)Read & practice →58Kernel Ring Buffer & Hardware Logs (dmesg)Read & practice →59Boss Challenge 6: Disk Space Outage EmergencyRead & practice →60Listing Running Processes (ps)Read & practice →61Interactive Process Monitor (top)Read & practice →62Listing Open Files (lsof)Read & practice →63Stopping Rogue Processes (kill)Read & practice →64Running Jobs in the BackgroundRead & practice →65Process Niceness (nice & renice)Read & practice →66Resuming Background Jobs (bg)Read & practice →67Finding & Killing Processes by Name (pgrep, pkill, killall)Read & practice →68Persistent Processes & Live Monitoring (nohup & watch)Read & practice →69Boss Challenge 7: Rogue Cryptominer NeutralizationRead & practice →70Testing Connectivity (ping)Read & practice →71Network Interfaces & Local IPRead & practice →72Checking Interfaces (ifconfig)Read & practice →73Network Connections (nmcli)Read & practice →74Socket & Connection Stats (netstat & ss)Read & practice →75Tracing Packet Routes (traceroute)Read & practice →76Downloading Web Files (curl)Read & practice →77DNS Resolution & Lookups (dig, nslookup & host)Read & practice →78Routing Tables & Gateways (ip route)Read & practice →79Port Testing & File Downloads (nc & wget)Read & practice →80Managing System Hostnames (hostname & hostnamectl)Read & practice →81Boss Challenge 8: DNS Poisoning RemediationRead & practice →82Finding Files by Name (find)Read & practice →83Checking Command HistoryRead & practice →84Consulting Manual PagesRead & practice →85Advanced find by Size, Time & Exec (-size, -mtime, -exec)Read & practice →86Indexed Search & Command Introspection (locate, whereis, type)Read & practice →87Searching Manual Page Descriptions (apropos & whatis)Read & practice →88Boss Challenge 9: Lost Disaster Recovery ArchiveRead & practice →89Controlling Services (systemctl)Read & practice →90System Logging (journalctl)Read & practice →91Enabling Services at Boot (systemctl enable & disable)Read & practice →92System Clock, Timezones & Power (timedatectl & shutdown)Read & practice →93Boss Challenge 10: Production Web Service RecoveryRead & practice →94Editing Config Files (nano)Read & practice →95Vim Basics: Modes, Saving & Exiting (vim)Read & practice →96Vim Navigation, Deleting & Searching (dd, yy, p, /)Read & practice →97Boss Challenge 11: Corrupted Server ConfigurationRead & practice →98Writing Your First Bash ScriptRead & practice →99Variables & Arguments ($1)Read & practice →100Conditional Logic (if/else)Read & practice →101Automating with LoopsRead & practice →102Reusable Logic (bash functions)Read & practice →103Scheduling Tasks (crontab)Read & practice →104Exit Codes & Logical Chaining ($?, &&, ||)Read & practice →105User Input & Command Substitution (read & $(...))Read & practice →106while Loops & case StatementsRead & practice →107Boss Challenge 12: Automated Healthcheck ScriptRead & practice →108Stream Editing with sedRead & practice →109Data Extraction with awkRead & practice →110Translating & Cutting DataRead & practice →111Parsing JSON in the Terminal (jq)Read & practice →112Advanced Counting & Numeric Sorting (uniq -c & sort -nr)Read & practice →113Binary & Hex Inspection (strings & xxd)Read & practice →114Boss Challenge 13: Data Pipeline NormalizationRead & practice →115Managing Environment VariablesRead & practice →116Inspecting the EnvironmentRead & practice →117Finding Commands (which)Read & practice →118Custom Shell Shortcuts (alias)Read & practice →119Reloading Shell Configs (source & .bashrc)Read & practice →120Cleaning the Environment (unset & unalias)Read & practice →121Boss Challenge 14: Compromised Environment CleanupRead & practice →122Archives & Compression (tar)Read & practice →123File Compression (gzip & gunzip)Read & practice →124Archiving with zip & unzipRead & practice →125Alternative Compression (bzip2 & xz)Read & practice →126Creating Links (ln -s)Read & practice →127Processing Search Results (xargs)Read & practice →128Repairing Symbolic Links (ln -sf)Read & practice →129Incremental Sync with rsyncRead & practice →130Verifying File Integrity (sha256sum & md5sum)Read & practice →131Block Cloning & Temp Files (dd & mktemp)Read & practice →132Boss Challenge 15: Corrupted Backup & Checksum RecoveryRead & practice →133User Administration (useradd & passwd)Read & practice →134Managing Users (adduser & userdel)Read & practice →135Viewing User Identities (id)Read & practice →136Group Administration (groupadd & groups)Read & practice →137Deleting Groups (groupdel)Read & practice →138Switching Security Contexts (su)Read & practice →139Secure Shell Access (ssh)Read & practice →140Secure File Transfer (scp)Read & practice →141Modifying User Groups & Shell (usermod)Read & practice →142SSH Key Authentication (ssh-keygen & ssh-copy-id)Read & practice →143Auditing Active Sessions (who, w & last)Read & practice →144Terminal Multiplexing (tmux)Read & practice →145Boss Challenge 16: Unauthorized User & Group AuditRead & practice →146Version Control Basics (git status, diff, log)Read & practice →147Inspecting Linux Containers (docker ps, logs, exec)Read & practice →148Staging & Committing Code (git add, git commit, git branch)Read & practice →149Managing Container Lifecycle (docker start, stop, restart)Read & practice →150Boss Challenge 17: Containerized Hotfix & Git DeploymentRead & practice →

03 / Transfer your skills

From the browser to a real machine.

The browser terminal is a JavaScript simulator. It models selected commands; it does not run a Linux kernel, contact remote hosts, install real packages, or implement all of Bash. These labs run in your own disposable Linux environment. They are self-assessed and do not award quest XP.

01 / Your first real Linux machineStart here

Create a disposable Linux environment and learn what the browser cannot simulate.

  1. Use an existing spare Linux machine or create a virtual machine from an official Ubuntu, Debian, or Fedora installation image. Verify the image against the publisher’s checksum. In the VM installer, select only the virtual disk; keep host disks disconnected from the guest.
  2. Create a regular user, finish installation, and take a VM snapshot named clean-install. A terminal on macOS is not a Linux environment. WSL is useful for command practice on Windows, but its boot and device behavior differs from a full VM.
  3. Run the read-only commands below. Record your distribution, kernel version, user, shell, and home directory. Explain why the distribution version and kernel version are separate.
  4. Create ~/linux-lab and keep later experiments there. Before administrative labs, take another snapshot. Revert it when you need a clean baseline.
cat /etc/os-release
uname -r
whoami
printf "%s\n" "$SHELL" "$HOME"
mkdir -p ~/linux-lab
cd ~/linux-lab
pwd

What to demonstrate

A short system inventory and a working snapshot or other recovery method. Explain terminal versus shell versus kernel without looking it up.

Recovery

Revert the VM snapshot. Keep any notes you need outside the disposable guest before reverting.

02 / A backup with a proven restoreFiles + archives

Create data, back it up, restore it somewhere new, and compare every recovered file.

  1. In your disposable Linux environment, run the commands below to make a unique workspace. They operate only inside that newly created directory.
  2. Inspect the archive listing before extraction. Restore into the empty restore directory, never over your only working copy.
  3. Confirm diff produces no output and exits successfully. Edit restored notes.txt and rerun diff; explain why it now reports a difference.
  4. Write down which permissions and ownership your backup method preserves. Identify where an independent copy would live if this disk failed.
lab_dir=$(mktemp -d)
cd "$lab_dir"
mkdir source restore
printf "Linux practice\n" > source/notes.txt
cp source/notes.txt source/second.txt
tar -czf backup.tar.gz source
tar -tzf backup.tar.gz
tar -xzf backup.tar.gz -C restore
diff -r source restore/source
sha256sum backup.tar.gz

What to demonstrate

The archive listing, a clean comparison, a deliberately detected difference, and a written recovery procedure.

Recovery

Keep the unique workspace until you finish reviewing it. It can be removed later after confirming its exact path; no system files were changed.

03 / A script that handles failureBash + testing

Write and test a script with quoted arguments, a clear error path, and meaningful exit statuses.

  1. Create report.sh in your practice directory with the script below. This lab runs in real Bash; it is not graded by the browser simulator.
  2. Run bash -n report.sh to check syntax. Run bash report.sh with no arguments and inspect echo $?; expect 2 and a usage message on stderr.
  3. Create a directory named sample data, add a few files, and run bash report.sh "sample data". Expect 0 and one output path per file. Try a nonexistent directory and expect 1.
  4. Explain why the script quotes "$1", why diagnostics go to stderr, and why checking syntax alone does not establish correctness.
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
  printf "Usage: report.sh DIRECTORY\n" >&2
  exit 2
fi
if [ ! -d "$1" ]; then
  printf "Not a directory: %s\n" "$1" >&2
  exit 1
fi
find "$1" -type f

What to demonstrate

Record all three test cases, actual exit codes, stdout, and stderr. Add a test for an empty directory.

Recovery

The script only inspects files. Edit or remove the script within your practice directory to start again.

04 / Diagnose a service incidentServices + networking

Distinguish a missing listener, a stopped service, and an application error using evidence.

  1. Use a disposable VM with systemd and a web service you installed through its package manager, such as nginx. Take a snapshot first. Avoid performing this lab on a public server.
  2. Inspect systemctl status nginx, journalctl -u nginx -b, and ss -lnt. Test curl -I http://127.0.0.1 and record the healthy baseline.
  3. Stop the service with sudo systemctl stop nginx. Repeat the same observations and explain the changed listener and HTTP response. Restore with sudo systemctl start nginx.
  4. Compare systemctl is-enabled nginx with systemctl is-active nginx. Inspect the configuration using sudo nginx -t. Write an incident report with symptom, hypothesis, evidence, change, verification, and rollback.
systemctl status nginx
journalctl -u nginx -b --no-pager -n 30
ss -lnt
curl -I http://127.0.0.1
systemctl is-enabled nginx
systemctl is-active nginx

What to demonstrate

Before, during, and after observations showing why the application was unreachable. Confirm the restored HTTP response, not just the service status.

Recovery

Start nginx again or revert the snapshot. If the distribution does not use systemd, use a systemd-based disposable VM for this exercise.

05 / Permissions and access auditSecurity + diagnosis

Predict permission effects, reproduce them without root, and explain least privilege.

  1. Run this lab as your regular user, not root. Create a unique workspace and file with the commands below. Predict whether cat can read the file after each chmod.
  2. With mode 000, cat should report Permission denied. Restore mode 600 and confirm you can read it. Compare ls -l with your prediction.
  3. Explain why permissions for a directory mean different things from permissions for a file. Explain why running this experiment as root can invalidate the prediction.
  4. Read id and groups. Describe the difference between ownership, group membership, and mode bits. Propose access for a private key and for a shared read-only document.
lab_dir=$(mktemp -d)
cd "$lab_dir"
printf "private\n" > note.txt
chmod 000 note.txt
cat note.txt
chmod 600 note.txt
cat note.txt
ls -l note.txt
id
groups

What to demonstrate

A permission prediction table, the observed denial and recovery, and a least-privilege explanation for both proposed files.

Recovery

Restore mode 600 on note.txt. All changes are confined to the temporary workspace.

What comes after this path?

You should be able to navigate, manipulate data, diagnose common failures, write small scripts, and verify routine changes. Kernel development, advanced storage, SELinux/AppArmor policies, high availability, and production architecture require further specialist practice. Check the manuals installed on your system for its exact behavior.

Return to your quest dashboard →