Reference

Cheat Sheet

The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.

sed & awk

Stream-edit text (sed) and process columns (awk) on the command line.
CommandWhat it doesExample
sed substituteReplace the first match per line.sed 's/foo/bar/' file.txt
sed globalReplace every match on each line.sed 's/foo/bar/g' file.txt
sed -iEdit the file in place.sed -i 's/localhost/127.0.0.1/g' config.yml
sed deleteDelete matching lines.sed '/^#/d' config
sed -n pPrint a line range.sed -n '10,20p' file.txt
awk print columnPrint a field (1-indexed).awk '{print $2}' data.txt
awk -FSet the field separator.awk -F, '{print $1}' data.csv
awk filterPrint rows matching a condition.awk '$3 > 100' sales.txt
awk sumSum a column.awk '{s += $1} END {print s}' nums.txt
awk NRUse the line number (NR).awk 'NR == 1' file.txt
awk with textMix fields with literal text.awk '{print "id:", $1}' users.txt