Track 02 of 12 · Compose small tools

Streams, Pipes & Text

Learn the byte-stream model that lets command-line programs work together. Route data, react to status, search text, and build inspectable pipelines.

Ten concepts, in learning order

Each lesson assumes the ideas above it and prepares you for the ones below.

  1. 01Standard input, output, and errorA command-line process normally starts with three conventional open streams: standard input for incoming data, standard output for primary results, and standard error for diagnostics.
  2. 02RedirectionRedirection is shell syntax that opens, closes, or duplicates file descriptors for a command before that command begins executing.
  3. 03PipelinesA pipeline connects the standard output of each command to the standard input of the next, allowing multiple processes to transform a byte stream concurrently.
  4. 04Exit statusAn exit status is a small integer produced when a command or pipeline completes; zero conventionally means success and nonzero meanings are defined by that command's interface.
  5. 05Conditional command executionThe shell operators && and || conditionally execute a following pipeline according to the preceding pipeline's exit status, with left associativity and short-circuit evaluation.
  6. 06Text search with grepgrep reads text input, tests each line against one or more patterns, and normally writes selected lines to standard output.
  7. 07Regular expressionsA regular expression is a pattern language for matching text, with exact syntax and features determined by the selected regex dialect and tool mode.
  8. 08Selecting fields with cutcut selects byte, character, or delimiter-separated field positions from each input line without parsing quoting or nested record formats.
  9. 09Sorting and deduplicating textsort orders input lines according to keys, locale, and options, while uniq compares adjacent lines and reports or removes adjacent repetitions.
  10. 10Counting with wcwc reports counts of lines, words, bytes, or characters from files or standard input according to the selected options and locale.

Continue the curriculum

Next: Finding & Transforming Data

Find files safely and reshape text or structured data with focused command-line tools. Learn where record boundaries, quoting, and format-aware parsing matter.

Open track 3