Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Pipes and Filters

Towha edited this page Mar 24, 2020 · 1 revision

cat displays the contents of its inputs.

head displays the first 10 lines of its input.

tail displays the last 10 lines of its input.

sort sorts its inputs.

wc counts lines, words, and characters in its inputs.

command > file redirects a command’s output to a file (overwriting any existing content).

command >> file appends a command’s output to a file.

first | second is a pipeline: the output of the first command is used as the input to the second.

The best way to use the shell is to use pipes to combine simple single-purpose programs (filters).

Clone this wiki locally