The | is a pipe, and it is the single best idea in the terminal. It takes whatever the command on the left prints and feeds it straight into the command on the right, instead of to the screen.
In sort shopping.txt | head -3, sort produces the whole tidy list, but nobody ever sees it: it flows down the pipe into head, which keeps only the first three lines. Together they answer a brand new question ("what are the first three items alphabetically?") that neither command could answer alone.
ls | wc -l is the same trick with a different pair: ls lists the names, wc -l counts them. That is how you count the things in a folder without counting them yourself. Small commands joined by pipes can do enormous jobs, and that is really the whole philosophy of the terminal.
sort shopping.txt | head -3The first three, alphabetically.ls | wc -lCount what is in this folder.cat *.txt | sortJoin files, then sort the lot.- ○Sort the shopping list and keep only the top few
- ○Count this folder's contents with a pipe
Open this level in your browser to type the commands at a live terminal that answers back.