Stage 2 · Lesson 4 of 9
Pipes: joining small tools
A , the | character, sends the output of one command straight into the next command. Small tools then combine into something useful. For example, history | grep git | tail -5 takes your command history, keeps only lines mentioning , then shows the last five.
This is the idea: each program does one job well and works with plain text. The text tools you meet next, such as grep, sort, uniq and wc, are built to sit inside a pipeline like this. Build a pipeline one step at a time, and check the output before adding the next command.
Common trapwriting a long pipeline in one go, getting nothing out, and not knowing which step failed.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
MIT's lectures on the shell and shell tools, with exercises after each one
- BookFreeThe Linux Command Line
William Shotts · Beginner
A free book that explains the shell step by step; the first part covers this whole stage
Practise
Keep handy
Also worth your time
- roadmap.sh: Shell / BashGo deeper
The full map of shell and Bash topics, to see what comes after the basics