Why Is It Called 'Pipe'? — The Origin of the Term
A plumber connects two pipes — one carries water in, the other carries water out. The joint is seamless, invisible, efficient. Now imagine doing the same with programs: connecting the output of one command directly to the input of another. No files. No manual copying. No intermediate steps. In Unix, you do it with a single character: |. And you call it a pipe.
The Story
The pipe was the invention of Douglas McIlroy at Bell Labs in the early 1970s. McIlroy was a key architect of the Unix philosophy: “Write programs that do one thing and do it well. Write programs to work together.” The pipe was the mechanism that made this philosophy practical.
Before pipes, connecting two programs meant using a temporary file:
sort file.txt > /tmp/sorted
uniq /tmp/sortedWith a pipe, the temporary file disappears:
sort file.txt | uniqMcIlroy proposed the pipe concept in 1964 — years before Unix existed — but it wasn’t implemented until 1972. Ken Thompson added the | operator to the Unix shell overnight when a colleague suggested the syntax. The next day, grep and who and sort could suddenly be connected in ways their original authors never imagined.
The physical plumbing metaphor is deliberate. In real plumbing, water flows through a pipe from a source to a destination. In Unix, data flows through a pipe from one process’s standard output to another’s standard input. The pipe itself is a buffer — typically 64KB on modern Linux — that holds data in transit, smoothing out the speed difference between producer and consumer.
How It Evolved
The pipe operator | became the hallmark of Unix command-line style. A single command is useful. A pipeline of commands connected by pipes is transformative:
cat access.log | grep "404" | cut -d' ' -f1 | sort | uniq -c | sort -rn | head -20This one-liner reads a web server log, finds all 404 errors, extracts the IP addresses, counts unique visitors, and shows the top 20 offenders. Six programs working together, each doing one thing well, connected by pipes.
The metaphor spread beyond the command line:
- Pipeline pattern in software architecture: A sequence of processing stages where the output of one stage feeds the input of the next. CI/CD pipelines, data processing pipelines, and ETL pipelines all use the same concept.
- Named pipes (FIFOs): Pipes that exist as files in the file system, allowing unrelated processes to communicate. Created with
mkfifo. - PowerShell: Microsoft adopted the pipe metaphor, but passing objects (not text) between commands. Its commands are named with verb-noun pairs (Get-Process, Where-Object, ForEach-Object), but the
|operator remains.
The pipe became a cornerstone of the Unix philosophy. If a program reads from stdin and writes to stdout, it can participate in a pipeline. That constraint — enforced by the pipe — forced programs to be simple, focused, and composable.
Did You Know?
The pipe character | is often called the “vertical bar” or “pipe symbol.” On many keyboards, it’s the shifted version of the backslash \. In some early systems, it was represented as an exclamation mark !.
A pipeline can be arbitrarily long. The record for the longest useful Unix pipeline is debatable, but pipelines of 10-15 commands are common in sysadmin scripts. The shell creates a separate process for each command in the pipeline and connects them with multiple pipes.
The pipe was so revolutionary that it’s now built into virtually every operating system’s kernel, not just Unix. Windows NT has anonymous pipes, named pipes, and the | operator in cmd.exe and PowerShell. The concept is universal because the metaphor is universal: data flows, pipes connect, and everyone understands plumbing.
FAQ
Related Etymologies
Why Is It Called 'Stack'?Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro