Shell and Environment

pipe

Sends output from one command into another.

The pipe operator is not a program; it is shell syntax for connecting standard output to standard input.

Syntax
command1 | command2

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Filter logs
journalctl -u nginx | grep -i error | less

Passes service logs through grep and then into a pager.

Count matches
grep -i error app.log | wc -l

Counts matching lines.

pipe Command
FieldDetails
Commandpipe
CategoryShell and Environment
Primary useSends output from one command into another.
Syntaxcommand1 | command2