sysadmin
System administration tasks
-
apt
Search, install, remove and upgrade packages with apt, including how to see what it will do before it does it, and which commands are safe in a script.
-
apt-cache
Search the package cache, read a package's record, follow its dependencies, and use policy to see which version apt would install and from where.
-
apt-file
Tested apt-file examples: searching Debian's file index for a command you have not installed, and the substring trap in a plain pattern.
-
blkid
Tested blkid examples: reading a filesystem's UUID, label and type, single-value output for scripts, searching by tag, and probing past the cache.
-
chage
Tested chage examples: reading the ageing settings, expiring passwords on a schedule, forcing a change, and expiring the whole account on a date.
-
chown
Tested chown examples: setting owner and group, -R over a tree, why a glob misses the dotfiles, and the reason you cannot give away a file you own.
-
crontab
Tested crontab examples: schedule syntax, @reboot/@daily shortcuts, per-user crontabs, and the PATH gotcha that breaks jobs that work fine in your shell.
-
date
Tested date examples: formatting with a + string, parsing a date with -d, arithmetic that crosses a month boundary, file timestamps, and time zones.
-
dd
Tested dd examples: making disk images, choosing a block size, seek and skip, conv=notrunc, sparse files, and why the output argument is the dangerous one.
-
df
Tested df examples: reading the output, asking about the filesystem a path is on, choosing columns and units, and the full disk that still reports free space.
-
dpkg
Query what's installed, find which package owns a file, inspect a .deb before trusting it, and repair a half-finished install: the layer beneath apt.
-
du
Tested du examples: -sh totals, --max-depth, apparent size versus allocated blocks, sparse files, hard links, excludes, and sorting the output.
-
env and printenv
Tested env and printenv examples: reading a variable, running one command with a changed environment, and what -S fixes on a shebang line.
-
free
Tested free examples: which column to read, why free memory is small on a healthy machine, units, swap and commit, and why a container sees its host.
-
fsck
Tested fsck examples: checking without repairing, forcing a check past the clean flag, reading the exit status, and repairing a damaged filesystem.
-
fuser
Tested fuser examples: which processes hold a file, what is keeping a filesystem busy, reading the access letters, and killing the holders with -k.
-
getent
Tested getent examples: passwd, group, hosts and shadow through NSS, the exit status a script reads, and the members a group listing leaves out.
-
id
Tested id examples: the three parts of the line, real against effective uid under a setuid binary, and the group a running shell has not picked up.
-
job control
Tested jobs, fg, bg, disown and nohup examples: the jobs table, job specs like %1, suspending and resuming, and why none of it works in a script.
-
journalctl
Tested journalctl examples: filtering by unit, priority and time, following logs live, output formats, and controlling journal disk usage.
-
kill
Tested kill, pkill and killall examples: choosing a signal, why -9 is a last resort, matching by name or command line, and signalling a whole process group.
-
lsof
Tested lsof examples: what has a file open, which process holds a port, finding a deleted file that is still using disk space, and narrowing the output.
-
man
Tested man and apropos examples: what the section numbers mean, searching by description, finding which package shipped a page, and reading a synopsis.
-
adduser, useradd and friends
Tested examples for adduser, useradd, usermod, deluser and the group commands: why Debian ships two of each, and the -aG that silently drops every other group.