Cheat sheet
xargs cheat sheet
Turn lines of input into command arguments with xargs: safe handling of spaces, one command per item, placeholders, parallel jobs and dry runs.
Cheat sheet
Turn lines of input into command arguments with xargs: safe handling of spaces, one command per item, placeholders, parallel jobs and dry runs.
Cheat sheet
Slice and reshape text on the command line with cut, tr, paste, column, comm, join, sort and awk: columns, CSV, joins and set operations.
Cheat sheet
Save a command's output to a file while still passing it on: logging long jobs, writing root-owned files with sudo, and splitting a stream to several places.
Cheat sheet
Manage systemd services with systemctl: status, restarts, enabling at boot, drop-in overrides, dependencies, timers and user services.
Cheat sheet
SSH keys, config, jump hosts, port forwarding, scp and sshd hardening: the commands and settings I use on every server.
Cheat sheet
Sort lines by number, size, version or a single column, remove or count duplicates, and rank the most common values with sort and uniq.
Cheat sheet
Find and replace, delete and print lines with sed, and edit config files in place safely, with the GNU and macOS differences.
Cheat sheet
Regular expressions for grep, sed and awk: the syntax, how basic, extended and Perl-style regex differ, and patterns for IPs, dates and log lines.
Cheat sheet
Find, inspect, signal and prioritise processes on Linux: ps, top, kill and its signals, jobs, nohup, nice, ionice and /proc.
Cheat sheet
How pipes, redirects, xargs and tee fit together, plus the one-liners I use most: old files, top IPs, sort | uniq -c and friends.
Cheat sheet
Filter, reshape and summarise JSON on the command line with jq: selectors, select, map, group_by and the flags for scripts.
Cheat sheet
Show the first or last lines or bytes of a file, follow logs that rotate, skip headers and cut out a range of lines with head and tail.