Connect Processes With a Named Pipe
Create a FIFO that lets unrelated processes exchange a data stream.
Run mkfifo /tmp/p.pipe to create a pipe, then write with one process and read with another.
01Command
Command
$ mkfifo /tmp/demo.pipe; (printf 'hello\n' > /tmp/demo.pipe &); cat /tmp/demo.pipe02What it does
A named pipe appears in the filesystem but carries a stream like an anonymous pipe, so two processes that cannot be joined with | can still communicate. It is used in shell automation to fan out data, coordinate jobs and stream between tools that only take filenames.
03Risk
!Warning: Opening a FIFO for reading blocks until a writer appears, which can hang a script; pair readers and writers carefully.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- mkfifo.1.en.html manual pageEvidence: Documents mkfifo, which creates FIFO special files for inter-process communication.
- mkfifo(1) — Linux manual pageEvidence: Documents creating named pipes.
Last verified: 2026-10-13 · Category: Developer