# Pipe (|)

> The | sign. It sends what one command prints into the next command.

**Field:** Infrastructure  
**Category:** Linux & the Command Line  
**Also known as:** Pipe Operator, Shell Pipe, Pipeline (Shell)

## Think of it like

Think of it like a water pipe between two sinks. What drains out of one flows into the next.

## Definition

A pipe sends what one command prints into the next command. You write it as a straight bar, |, between the two commands. The first command does not print to the screen. Its output flows into the second one instead. You can join many small commands this way to do one bigger job.

## Example

Emma has a long list of names. She pipes it into sort, and the names come back in order.

## Example code

```console
$ printf "pear\napple\nfig\n" | sort
apple
fig
pear
```

Three words flow through the pipe into sort, and come out in order.

## Why it matters

Small commands each do one job. A pipe joins them, so you rarely need a big program.

## Common mistake

Mixing up | and >. A pipe feeds another command, and > writes into a file.

## Three principles

- **Output to input.** One command feeds the next.
- **Small tools.** Each command does one job.
- **Chain many.** Join as many as you need.

## Related terms

- [Shell](https://learn.benibix.com/term/infrastructure/shell)
- [Command Line](https://learn.benibix.com/term/infrastructure/command-line)
- [ls](https://learn.benibix.com/term/infrastructure/ls-command)

## Taught in

- [Pipes and man Pages](https://learn.benibix.com/learn/infrastructure-linux/pipes-and-man-pages): Linux CLI, 2/10

![Two command boxes joined by a pipe sign. The first, printf, prints three words, pear, apple and fig, which flow through the pipe into sort. Sort passes apple, fig and pear in order to the screen at the end.](https://learn.benibix.com/diagrams/inf3-pipe.svg)

---

Source: https://learn.benibix.com/term/infrastructure/pipe
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
