Linux, terminal and Git

Stage 2 · Lesson 4 of 9

Pipes: joining small tools

Shell basics

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

Practise

  • A game played over SSH where each level needs a new command, from `ls` to finding hidden files

Keep handy

  • Paste any command and see what each part does before you run it

  • Short, example-first help pages for common commands when a man page is too long

Also worth your time

Mark this stage as not done?