Master intermediate Linux administration with hands-on labs aligned to CompTIA Linux+ (XK0-006) exam objectives. Package management, firewall security, scripting, and automation.
Intermediate Linux administration: package management, services, firewall hardening, shell scripting, and cron automation.
/etc/apt/sources.list. This does NOT install anything — it only updates the local index so APT knows what versions are available.apt update regularly prevents stale installs
sudo apt update before installing anything. Stale package lists can cause version conflicts!-y flag automatically answers "yes" to the confirmation prompt. Without it, APT asks you to confirm before downloading and installing. In scripts, always use -y for unattended installs.dpkg -l lists ALL installed packages. Pipe it through grep to find specific ones. The ii prefix means "installed".apt handles repos and dependencies, dpkg handles individual .deb files. apt calls dpkg under the hood.start — runs the service now (this session only)enable — tells systemd to start it automatically on bootcurl http://localhost sends an HTTP request to the local web server. If Nginx is running, you'll see the default welcome page HTML.-u to filter by service (unit). --no-pager prevents pagination, and -n 10 limits to last 10 entries.journalctl -u <service> is the go-to for troubleshooting any systemd service. Add -f to follow logs in real-time!--state=running to filter only active services. Without it, you see ALL units including stopped ones.apt autoremove cleans up orphaned dependencies that are no longer needed.apt remove keeps config files. Use apt purge to remove configs too. In production, verify before removing!sudo ufw allow 22/tcp BEFORE sudo ufw enable!ufw allow ssh, ufw allow http. But specifying port/protocol is more explicit and recommended on exams.sed -i edits files in-place. The s/old/new/ syntax replaces the first occurrence of "old" with "new". Watch the Security Dashboard for the change!.sh extension is a convention — Linux uses permissions, not extensions, to determine executability.chmod +x, you'll see -rwxr-xr-x — the x means execute permission is set. Without it, you'd get "Permission denied"!#!/bin/bash line (called shebang) tells the system which interpreter to use. Without it, the default shell runs the script. Always include it for portability.> overwrites the file, >> appends to it. Use > for the first line and >> for subsequent lines!> (overwrite) with >> (append). Using > when you mean >> will erase your script!bash script.sh or ./script.sh (if executable). Using bash directly doesn't require +x permission — it explicitly calls the interpreter.* matches any characters. /tmp/backup*.tar.gz finds all backup archives regardless of the date suffix.awk is a powerful text processor. {print $5} prints the 5th column (the "Use%" column from df output).* * * * * = minute hour day-of-month month day-of-week0 2 * * * = every day at 2:00 AM*/5 * * * * = every 5 minutescrontab -e to edit interactively, crontab -l to list.active (running) — cron daemon is operational