Linux CLI Essentials¶
A comprehensive guide to working effectively on the Linux command line. These guides take you from "I can type commands" to understanding how the shell actually works and using it productively.
Each topic is covered in its own guide. Start anywhere - they're self-contained, but the order below follows a natural learning path.
Guides¶
What the shell is, how it starts up, and how it processes your input. Covers shell types, configuration files, the PATH variable, variables, quoting rules, and shell expansions.
How programs communicate through STDIN, STDOUT, and STDERR. Covers redirection, here documents, file descriptor manipulation, pipelines, and process substitution.
The core toolkit for searching, transforming, and analyzing text. Covers grep, sed, awk, cut, sort, uniq, tr, wc, head, tail, and tee.
The pattern-matching language used across Linux tools. Covers metacharacters, character classes, quantifiers, backreferences, BRE vs ERE vs PCRE, lookahead/lookbehind, and practical patterns.
Searching directory trees and operating on the results. Covers find (name, type, size, time, permission tests, logical operators, and actions) and xargs.
The Linux permission model explained. Covers chmod (symbolic and octal modes), chown, chgrp, umask, and special permission bits (setuid, setgid, sticky bit).
Managing processes from the terminal. Covers foreground/background processes, signals, kill/killall/pkill, nohup, disown, ps, top/htop, and terminal multiplexers.
Writing reliable bash scripts. Covers exit codes, conditionals, loops, functions, and error handling with set -euo pipefail and trap.
Managing storage. Covers df, du, mount/umount, /etc/fstab, lsblk, partition management with fdisk/parted, mkfs, and fsck.
Installing, updating, and removing software. Covers apt and dnf workflows, low-level tools (dpkg, rpm), repository management, universal formats, and version pinning.
Managing services with systemd. Covers systemctl, unit file anatomy, writing custom services, journalctl log filtering, targets, and systemd timers.
Managing users, groups, and access control. Covers useradd/usermod/userdel, /etc/passwd and /etc/shadow, group management, the sudo system, PAM basics, and user auditing.
Deep dive into SSH configuration and key management. Covers key generation, ssh-agent, ~/.ssh/config patterns, SSH certificates, sshd_config hardening, and port forwarding.
Finding, filtering, and managing system logs. Covers /var/log/ structure, journalctl filtering, rsyslog configuration, logrotate setup, and structured log parsing.
Essential networking from the command line. Covers ping/traceroute/mtr, curl/wget, ssh, scp/rsync, ss/ip, dig/nslookup, and nc (netcat).
Understanding what's running on a system. Covers uname, uptime, free, lscpu, lsof, vmstat, the /proc and /sys virtual filesystems, and dmesg.
Bundling and compressing files. Covers tar (with gzip, bzip2, and xz), standalone compression tools, zip/unzip, and guidance on when to use each format.
Conventions that prevent real bugs. Covers set -euo pipefail, quoting variables, [[ ]] vs [ ], $() vs backticks, mktemp, shellcheck, and a script template.
Automating recurring tasks. Covers cron daemon, crontab syntax, system crontab files, cron environment gotchas, anacron, and systemd timers as a modern alternative.
Protecting your system from unauthorized network access. Covers the Netfilter framework, iptables, nftables, ufw, firewalld, default-deny policies, and stateful inspection.