What is a Pipe, and what is the difference between a Named and Unnamed pipe?

Last updated 5 July 2026

A pipe is a unidirectional IPC channel where one process writes bytes and another reads them in FIFO order, acting like an in-kernel buffer. The distinction is naming: an unnamed pipe exists only between related processes, while a named pipe has a filesystem name so unrelated processes can use it.

  • Unnamed (anonymous) pipe:

    • Created with pipe(); no name in the filesystem.

    • Only usable between related processes (parent/child) that inherit the file descriptors via fork().

    • Vanishes when all descriptors are closed; this is what the shell | operator uses.

  • Named pipe (FIFO):

    • Created with mkfifo; appears as a special file with a path name.

    • Unrelated processes can open it by name to communicate; persists in the filesystem until deleted.

  • Shared properties:

    • Byte-stream, FIFO order, fixed-size kernel buffer; a full buffer blocks the writer and an empty one blocks the reader.

    • Classic pipes are half-duplex (one direction); two are needed for bidirectional flow.

  • https://www.youtube.com/watch?v=I6g3eqTxqfg
  • https://dev.to/leandronsp/inter-process-communication-pipes-52nj
  • https://medium.com/@bayounm95.eng/understanding-pipes-in-linux-b12256d4720d
  • https://www.geeksforgeeks.org/operating-systems/demostrating-bidirectional-communication-using-ordinary-pipe/
All Operating Systems interview questions