Linux Text Processing: grep, awk, sed, sort, and Friends
Working reference for Linux text processing on the command line. grep with -i / -v / -r / -E / -A -B context / -c count / -l filenames-only, awk field-based ( to ) with custom -F separator and condition { action } pattern, sed s/old/new/g / -i in-place / -i.bak with backup / d for delete / p for print, sort -n / -k by column / -t separator, uniq -c -d (needs sorted input!), wc / head / tail -f / cut / tr character translations, and xargs with -0 for null-separated filenames. Real pipelines: top 10 404 IPs from nginx, active SSH users by frequency, mass sed-replace across config files. Pitfalls: grep regex vs -F fixed-string, sed -i destroys silently, tail -F (uppercase) for log rotation, xargs without -0 breaks on filenames with spaces.