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
10- 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.
- File permissions: rwx and chmodFile permissions: every file has three permission sets, for the owner, the group, and others. Each set is three bits: read (r), write (w), execute (x).
- SUID, SGID, sticky bit: the special permission bitsThree special permission bits beyond rwx: SUID runs as the file owner, SGID as the group or sets directory inheritance, sticky guards deletion.
- Linux capabilities: privilege bitsLinux capabilities split root's power into 40+ independent bits (NET_ADMIN, SYS_PTRACE, and so on). Grant a process a slice without making it full root.
- GPG/PGP: signing, encryption, web of trustGPG (GnuPG) is the OpenPGP implementation. Asymmetric keys sign and encrypt, the keyring manages them, web of trust acts as a distributed CA.
- Cosign and container image signing (sigstore)cosign is the standard for signing container images via sigstore (rekor + fulcio). Sign/verify, OIDC keyless, attestations, k8s integration.
System and services
6- 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.
- Automatic security updates (unattended-upgrades, dnf-automatic, livepatch)Automatic security updates: unattended-upgrades, dnf-automatic, kernel live patching with Canonical Livepatch and kpatch. Production setup without pain.
Disks and filesystems
8- 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.
- Block devices: disks in LinuxA block device is read and written in fixed-size blocks (usually 512B or 4K). Disks, SSDs, and NVMe drives are all block devices in `/dev/`.
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
19- 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.
- Default gateway: leaving your own networkDefault gateway: the router IP in your subnet where the stack sends packets bound for any address that is not local. How it works and when it breaks.
- Linux Bridge: software switchLinux bridge is a kernel L2 software switch: learns MACs in the FDB and forwards frames between interfaces. Used in Docker, KVM, libvirt, and vlan-aware setups.
- TCP three-way handshakeTCP connection opens with three packets: SYN from client, SYN-ACK from server, ACK from client. Connection is then Established and data transfer begins.
- TCP states (LISTEN, ESTABLISHED, TIME_WAIT)TCP session moves through 11 states from LISTEN to CLOSED. The most important in production: LISTEN, ESTABLISHED, TIME_WAIT, CLOSE_WAIT.
- TCP keepaliveTCP keepalive sends probes on an idle connection to detect a dead peer. Linux defaults: 7200s idle, 75s interval, 9 probes. Controlled via sysctl or setsockopt.
- Conntrack: how Linux remembers every network connectionConntrack is the Linux kernel subsystem that remembers every active connection, so NAT can route replies back and a firewall can tell new from established.
- MTU: maximum transmission unit and path MTU discovery (PMTUD)MTU sets the maximum IP payload a link can carry. PMTUD finds the path minimum via ICMP. Broken PMTUD blackholes large packets. MSS clamping fixes it.
- QUIC: modern transport over UDPQUIC transport over UDP with built-in TLS 1.3, multiplexing without HOL-blocking, 0-RTT, and connection migration. HTTP/3 is HTTP semantics over QUIC.
- MQTT: Publish/Subscribe for IoT and mobile pushMQTT lightweight pub/sub over TCP. QoS 0/1/2, retained messages, last will, 2-byte header. Brokers: mosquitto, EMQX, HiveMQ. IoT and mobile push.
- OpenVPN: TLS-based VPNOpenVPN is a TLS-based VPN with X.509 PKI: tun/tap modes, push routes, tls-auth/tls-crypt against handshake DDoS, TCP fallback on port 443.
- IPsec and IKEv2: the enterprise VPN standardIPsec is the VPN standard since 1995. ESP encapsulates, IKEv2 negotiates keys. Tunnel mode for networks, transport mode for host-to-host. On Linux, strongSwan.
- RADIUS: authentication for networks, VPN, and Wi-FiRADIUS AAA protocol for network auth: Wi-Fi WPA2-Enterprise, VPN, switch access. EAP inside RADIUS, FreeRADIUS as the standard open-source server.
- Kerberos: network single sign-onKerberos SSO with tickets and time-based authentication. The KDC issues a TGT, and the TGT is exchanged for service tickets. Core of AD and FreeIPA.
Kernel and monitoring
10- /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.
- Prometheus: scrape, TSDB, PromQL, and production pitfallsPrometheus pull model and TSDB: how scrape works, how PromQL evaluates, recording vs alerting rules, retention, and remote_write for long-term storage.
Containers
4- OCI spec: the container standardOCI is three specs from the Open Container Initiative: Image (layers + manifest), Runtime (config.json + rootfs), Distribution (registry API).
- runc, runsc, kata: container runtimesrunc is the reference OCI runtime (namespaces+cgroups). runsc/gVisor is a userspace kernel for isolation. kata is VM-based. Different trade-offs.
- cgroups v2: unified hierarchy, PSI, eBPF controlcgroups v2 uses one tree instead of v1 hierarchies. Controllers cpu/memory/io/pids, PSI pressure-stall info, eBPF control, systemd delegation.
- Kubernetes pod lifecycle: from Pending to TerminatedKubernetes pod lifecycle: phases Pending to Running to Succeeded/Failed, init containers, probes (startup/readiness/liveness), graceful shutdown.