Note -r searches recursively through directories. -n shows line numbers. -i is case-insensitive. -v inverts the match (shows non-matching lines). -c counts matches. -l lists only filenames with matches. Use -E for extended regex or egrep.
Note -i edits in place. -i.bak creates a backup before editing (strongly recommended). g flag replaces all occurrences on a line, not just the first. -n suppresses default output; use with p to print specific lines. /d deletes matched lines.
192.168.1.40 [28/Mar/2026:10:15:23
Alice 2340
Total: 87450
Note By default, awk splits on whitespace. -F sets a custom delimiter. $0 is the whole line, $1 is the first field, NR is the line number, NF is the number of fields. BEGIN runs before processing; END runs after.
Note -d sets the delimiter (default is tab). -f selects fields by number. -c selects character positions. For more complex extraction, awk is usually more flexible.
Note tr reads only from stdin (it cannot take a filename argument). -d deletes characters in set1. -s squeezes repeated characters. Converting \r is handy for fixing Windows line endings.
lowercaseuppercasetranslate charactersdelete charactersreplace characterfix line endings
Note -0 with find -print0 handles filenames with spaces and special characters safely. -I {} replaces {} with each input line. -P runs N processes in parallel for significant speedups on I/O-bound tasks.
pipe to commandbuild commandxargs parallelbatch commandstdin to args
Split Output to File and Stdout
Syntax
tee[options] file...
Example
make build 2>&1|tee build.logecho'new entry'|sudotee-a/etc/hosts
Note -a appends instead of overwriting. tee is essential for writing to root-owned files because 'sudo echo x > /root/file' fails (the redirect runs as your user, not root). Use 'echo x | sudo tee /root/file' instead.
save and displaywrite to file and stdouttee appendsudo write filesplit output
Format Tabular Output
Syntax
column[options]
Example
cat data.csv|column-t-s','mount|column-t
Output
name age department
Alice 30 Engineering
Bob 25 Marketing
Note -t creates a neatly aligned table. -s sets the input delimiter. Great for making CSV data or command output readable in the terminal.
format tablealign columnspretty printtabular output
Merge Lines Side by Side
Syntax
paste[options] file1 file2...
Example
paste-d',' names.txt scores.txtseq10|paste----
Output
Alice,95
Bob,87
Carol,92
Note -d sets the delimiter (default is tab). Using - multiple times reads successive lines from stdin into columns. The seq example arranges 1-10 into a 4-column layout.