whatis pipe

Pipe

Also known as: |, pipeline

The | operator, which sends the standard output of one command directly into the standard input of the next.

What Is a Pipe in Linux?

Pipes are the core of the Unix philosophy: small tools that each do one thing, chained together. In ps aux | grep nginx, the output of ps never touches disk; the kernel streams it straight into grep.

A pipeline returns the exit status of its last command by default. Bash set -o pipefail makes it return the first failure instead, so a broken step earlier in the chain is not hidden.

Example

journalctl -u nginx | grep -i error | sort | uniq -c | sort -rn | head