Definition
A pipe is the Unix mechanism that connects the standard output of one process directly to the standard input of another, so that data flows from the first to the second as a stream without ever touching a file on disk. At the shell level the pipe is written as the vertical-bar character between two commands. Under the hood it is a kernel-managed in-memory buffer with one end attached to each process's file descriptor table.
Pipes are the simplest form of interprocess communication. Producer writes, consumer reads, the kernel handles flow control by blocking the producer when the buffer fills and the consumer when it drains. No coordination protocol is needed beyond the byte stream itself. This simplicity is the reason pipes scale: any program that reads stdin and writes stdout can be a stage in any pipeline, regardless of what else is in the pipeline.
Why it matters
How it works
When the shell parses ls | grep foo, it calls the pipe() system call to ask the kernel for a pair of connected file descriptors. The shell then forks two child processes. In the first child, file descriptor 1 (stdout) is replaced with the write end of the pipe before exec-ing ls. In the second child, file descriptor 0 (stdin) is replaced with the read end of the pipe before exec-ing grep. Both processes now run concurrently. Whatever ls writes to stdout the kernel queues in the pipe buffer; grep reads from its stdin and processes the data as it arrives. When ls exits and closes its end, grep sees end-of-file and exits in turn. The pipe is then closed and reclaimed.
The shell extends this minimal mechanism into a richer language. Pipelines can chain three, four, or twenty stages, each running concurrently. Redirection operators connect process IO to files instead of pipes. Process substitution (the <(cmd) form) creates a named-pipe-like file descriptor so commands that expect filenames can consume pipeline output. Named pipes (created with mkfifo) persist in the filesystem and let unrelated processes connect through them. All of these are variations on the same kernel primitive — one process writes, another reads, the OS mediates the stream.