Slice and summarise text files with grep, sed and awk
8 steps · about 2 h 20 min · Beginner
- Find matching lines with grep and regular expressions (doc, GNU Project, 20 min)
Covers the options and regex syntax you need for fast searching.
- Substitute and delete text with sed (guide, Grymoire, 30 min)
A patient tutorial on the s command, addresses and in-place edits.
- Check sed commands and options in the manual (doc, GNU Project, 15 min)
The reference for exact behaviour of GNU sed flags and scripts.
- Process columns and totals with awk (guide, Grymoire, 35 min)
Teaches fields, patterns, variables and END blocks through examples.
- Write short awk programs from the gawk guide (doc, GNU Project, 20 min)
The official getting-started chapter grounds the one-liners in real syntax.
- Pick fields out of delimited lines with cut (doc, GNU Project, 5 min)
The quickest way to grab one CSV column before further processing.
- Sort lines by key and numeric value (doc, GNU Project, 10 min)
Explains -k, -t and -n so reports sort the way you expect.
- Count repeated values with uniq -c (doc, GNU Project, 5 min)
Completes the sort | uniq -c pattern for frequency counts.