Slice and summarise text files with grep, sed and awk

8 steps · about 2 h 20 min · Beginner

  1. Find matching lines with grep and regular expressions (doc, GNU Project, 20 min)

    Covers the options and regex syntax you need for fast searching.

  2. Substitute and delete text with sed (guide, Grymoire, 30 min)

    A patient tutorial on the s command, addresses and in-place edits.

  3. Check sed commands and options in the manual (doc, GNU Project, 15 min)

    The reference for exact behaviour of GNU sed flags and scripts.

  4. Process columns and totals with awk (guide, Grymoire, 35 min)

    Teaches fields, patterns, variables and END blocks through examples.

  5. 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.

  6. Pick fields out of delimited lines with cut (doc, GNU Project, 5 min)

    The quickest way to grab one CSV column before further processing.

  7. Sort lines by key and numeric value (doc, GNU Project, 10 min)

    Explains -k, -t and -n so reports sort the way you expect.

  8. Count repeated values with uniq -c (doc, GNU Project, 5 min)

    Completes the sort | uniq -c pattern for frequency counts.