⌨️Pipe (|)
Also known as Pipe Operator, Shell Pipe, Pipeline (Shell)
The | sign. It sends what one command prints into the next command.
Think of it like
Think of it like a water pipe between two sinks. What drains out of one flows into the next.
Example
Emma has a long list of names. She pipes it into sort, and the names come back in order.
Why it matters
Small commands each do one job. A pipe joins them, so you rarely need a big program.
Definition
Example code
console
$ printf "pear\napple\nfig\n" | sort
apple
fig
pearCommon mistake
Key takeaways
- 1Output to input. One command feeds the next.
- 2Small tools. Each command does one job.
- 3Chain many. Join as many as you need.