Knowledge base
A searchable reference for the commands and topics in the hands-on lessons.
Each article explains one thing and shows an example. Search by name, or browse the groups below. Lessons open these articles as hints, and each links back to the lessons where it is used.
Commands and the shell
9- Linux command anatomy: name, options and argumentsA Linux command is a name, options and arguments. Options change behaviour, arguments say what to act on.
- echo command in Linux: print text and variablesecho command in Linux prints its arguments and variable values to standard output.
- date command in Linux: current date and formatsdate command in Linux shows the current date and time and formats them with a string like +%Y-%m-%d.
- which, type, whereis in Linux: where a command liveswhich, type, whereis in Linux: find a program's path and tell whether a command is a file, alias or builtin.
- Help in Linux: --help and manHelp in Linux: --help prints a brief usage summary, man opens the full manual.
- Environment variables in Linux: env and exportEnvironment variables in Linux: env lists them, export makes a variable visible to child processes.
- PATH in Linux: where commands are foundPATH in Linux is a colon-separated list of directories the shell searches for a program by name.
- ~/.bashrc in Linux: shell configuration~/.bashrc in Linux is a script bash reads when it starts an interactive non-login shell.
- Aliases in Linux: the alias commandAn alias in Linux is a short name for a longer command; it becomes permanent in ~/.bashrc.
Files and directories
11- ls command in Linux: list directory contentsWhat is in a directory: ls -l, ls -a, ls -lh and hidden files.
- find command in Linux: search for filesFind files by name, type, size and time, and act on them in one go.
- Paths in Linux: absolute and relativePaths in Linux: an absolute path starts at /, a relative path is read from the current directory.
- Hidden files in Linux: the leading dotHidden files in Linux are files whose names start with a dot. ls -a shows them.
- mkdir, cp, mv, rm in Linux: working with filesmkdir, cp, mv, rm in Linux: make a directory, copy, move or rename, and delete a file.
- Filename globbing in Linux: wildcards and *Globbing in Linux: the shell expands the patterns *, ? and [...] into a list of matching filenames.
- Reading files in Linux: cat, head, tailcat, head, tail in Linux: print a whole file, show the first or last lines, or follow a growing file.
- less command in Linux: page through a fileless command in Linux scrolls a file one page at a time and lets you search its text, without loading the whole file into memory.
- file command in Linux: identify a file's typefile command in Linux identifies a file's type from its contents, not from the filename extension.
- locate command in Linux: fast indexed searchlocate command in Linux finds files through a prebuilt index of names, so it answers instantly.
- Text editors in Linux: nano and vimnano and vim in Linux are terminal text editors; nano is easier to start with, vim is on almost every machine.
Text and streams
8- grep command in Linux: search text by patternFind matching lines: grep -i, -r, -n, -v and grep in a pipeline.
- Output redirection in Linux: > and >>Output redirection in Linux: > writes a command's output to a file, >> appends, 2> captures errors.
- Pipes in Linux: | and the sort, uniq, cut filtersA pipe in Linux joins commands with |: the output of one becomes the input of the next.
- sed command in Linux: stream text editingsed command in Linux edits text in a stream: most often a substitution with s/pattern/replacement/g.
- awk command in Linux: field processingawk command in Linux splits lines into fields by whitespace and runs 'condition { action }' rules.
- Regular expressions in Linux: basics for grep and sedRegular expressions in Linux are a pattern language for text. grep, sed, and awk all use them to find and change text.
- xargs in Linux: build a command from inputxargs in Linux takes lines from standard input and passes them as arguments to another command.
- tee in Linux: write to a file and the screen at oncetee in Linux writes a stream to a file and the screen at the same time; handy to save output and still watch it.
Bash scripting
4- The script file and how it runsShebang, the execute bit, and ./script versus bash script.
- Variables and quotingAssignment with no spaces, $(...), and why you wrap values in "quotes".
- Loops in bashfor and while read, and why reading a file line by line is safer.
- Strict mode: set -euo pipefailFail on the first error instead of carrying on quietly.
Processes
5- Viewing processes: ps, pgrep, topWhat is running, under which PID, and how much it uses.
- Background jobs: &, jobs, fg, bgRun in the background and bring back to the front.
- Process priority: nice and reniceWho gets the CPU first.
- Signals and killTERM, KILL, HUP and how kill differs from kill -9.
- Open files in Linux: the lsof commandlsof in Linux shows which files and sockets are open and by which process; it helps find what holds a port.
Users and permissions
5- chmod command in Linux: file permissions (755, 644, rwx)Who can read, write and execute a file: the 755 and 644 modes, rwx and octal numbers.
- Users and groups: useradd, usermodCreate a user and change their groups.
- Owner and group: chown, chgrpWho owns a file and how to change it.
- sudo: become root for one commandRaise privileges for a single command and log it.
- SELinux and AppArmor in Linux: mandatory access controlSELinux and AppArmor in Linux limit what a process may do, even when the rwx permissions and root would allow it.
System and services
5- Package management in Linux: apt and dpkgapt and dpkg in Linux: apt installs and updates packages from repositories, dpkg handles a single .deb file.
- systemd services in Linux: the systemctl commandsystemctl in Linux manages services: start, stop, enable at boot, and check status.
- Logs in Linux: journalctl and /var/logjournalctl in Linux reads the systemd system log; older services also write text files under /var/log.
- Scheduling in Linux: cron and crontabcron in Linux runs commands on a schedule; you edit your own schedule with crontab -e.
- Time in Linux: timedatectl and timezonestimedatectl in Linux shows and sets the system time, the timezone and network time sync.
Disks and filesystems
7- What an inode isWhere a file really lives: ls -i, stat, df -i.
- Hard and symbolic linksln versus ln -s, and when to use which.
- Free inodes: df -iWhen there is space but files will not create.
- df and du in Linux: disk spacedf and du in Linux: df shows free space on filesystems, du shows the size of directories.
- Mounting in Linux: mount, fstab and lsblkmount in Linux attaches a disk's filesystem to the directory tree; fstab mounts it at boot.
- LVM in Linux: logical volumes (pvcreate, vgcreate, lvcreate)LVM in Linux pools disks together and carves out flexible volumes you can grow on the fly.
- Disk integrity in Linux: fsck and smartctlfsck in Linux fixes filesystem errors; smartctl reads a disk's health from its SMART data.
Archives
4- tar archivesCreate, inspect and extract: czf, tzf, xzf.
- gzip compressiongzip and gunzip, and why .tar.gz.
- Backup and restoreWhy you must test a backup by restoring it.
- File sync in Linux: the rsync commandrsync in Linux copies and syncs directories, sending only the changes; it works over the network through ssh.
Networking
6- ip command in Linux: addresses and interfaces (ip addr)ip command in Linux shows network state: ip addr for addresses, ip link for interfaces, ip route for routes.
- ss command in Linux: sockets and listening portsss command in Linux shows network sockets: which ports are listening and which connections are open.
- SSH in Linux: log in to a remote server and use keysssh in Linux opens a secure session on a remote server; scp copies files, ssh-keygen makes keys.
- Downloading in Linux: curl and wgetcurl and wget in Linux fetch files and talk to HTTP from the terminal; curl is more flexible, wget is simpler.
- Network and DNS in Linux: ping and digping in Linux checks whether a host is reachable; dig looks up an IP from a name through DNS.
- Firewall in Linux: ufw and nftablesA firewall in Linux decides which connections to allow; ufw is the simple front end, nftables is the engine.
Kernel and monitoring
9- /proc filesystem in Linux: a window into the kernel/proc in Linux is a virtual filesystem: the kernel exposes processes and system state as files inside it.
- sysctl in Linux: read and set kernel parameterssysctl in Linux reads and changes kernel parameters under /proc/sys, such as vm.swappiness.
- free command in Linux: memory usagefree command in Linux shows memory: how much is used, free, and cached.
- Load average in Linux: loadavg and uptimeLoad average in Linux is the average number of processes running or waiting for CPU or disk over 1, 5 and 15 minutes.
- vmstat command in Linux: memory, swap and CPUvmstat command in Linux summarizes processes, memory, swap, disk and CPU activity on one line.
- Live monitoring in Linux: top and htoptop and htop in Linux show a live process list and the system load; htop is friendlier and clearer.
- strace in Linux: trace system callsstrace in Linux shows the system calls a program makes: which files it opens, where it connects, and where it fails.
- perf in Linux: performance profilingperf in Linux shows where the CPU spends time: which functions and instructions use the processor the most.
- cgroups and namespaces in Linux: the basis of containerscgroups and namespaces in Linux are the kernel mechanisms behind containers: resource limits and process isolation.