one-liners
Short, self-contained shell one-liners
-
cowsay
Tested cowsay examples: piping output into it, the wrapping rules that catch people out, cowfiles and how to write one, and why -f on a download runs code.
-
curl
Tested curl examples: GET/POST/PUT/DELETE, headers, auth, cookies, uploads, redirects, retries, and scripting.
-
jq
Tested jq examples: picking values out of nested JSON, filtering with select, reshaping objects, and getting raw strings back out into a shell script.
-
sort
Tested sort examples: numeric vs lexicographic order, sorting by field with -k, human-readable sizes with -h, and checking whether a file is already sorted.
-
tee
Tested tee examples: saving a pipeline's output while still seeing it, appending with -a, and the sudo tee trick for writing files your shell cannot.
-
uniq
Tested uniq examples: why input must be sorted first, counting occurrences with -c, and isolating only the duplicates or only the singles.
-
Pipes and redirection
How | connects commands together, and how >, >>, 2>&1, and <() route data to and from files, other commands, and each other.
-
Bulk rename a batch of files
Rename many files at once with a plain bash loop, safely handling spaces and previewing changes before committing.
-
Find the largest files on disk
Locate what is eating your disk space, from a whole filesystem down to one directory.