Skip to content
Justice Tech School

Pipes and Pipelines

A pipe connects one command output to another input. Build pipelines from small tools. tee writes to a file and passes data on, and xargs turns lines into arguments.

Example
printf "pear\napple\npear\nfig\n" | sort | uniq -c | sort -rn
seq 5 | xargs -I{} echo "n={}"
echo text | tee /tmp/tee_demo.txt | tr a-z A-Z
rm /tmp/tee_demo.txt

Result

      2 pear
      1 fig
      1 apple
n=1
n=2
n=3
n=4
n=5
TEXT

Exercise

Write to a file and continue.

cmd |  out.txt | next

Quiz Test

Which turns lines into arguments?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.