MKFIFO(1) General Commands Manual Fully-rendered PDF

mkfifo, mknodcreate named pipe or special file

mkfifo [-m mode] [-Z|--context[=MAC]] fifo
mknod [-m mode] [-Z|--context[=MAC]] device c|b major minor
mknod [-m mode] [-Z|--context[=MAC]] fifo p

Creates the specified named pipes (FIFOs), or major:minor device nodes — character with c, block with b.

, --mode=mode
chmod(1)-style file permissions to create fifos (device) as, rather than the default a=rw - umask. Special bits are refused.
, --context
Create fifos (device) with the default SELinux contexts for their paths. Ignored without SELinux.
=MAC
Create fifos (device) with SELinux context set to MAC. Ignored (diagnostic issued) without SELinux.

if a file couldn't be created,

mkfifo(2), mknod(2), fifo(7)

Conforms to IEEE Std 1003.1-2024 (“POSIX.1”). --context and refusing special mode bits instead of ignoring them are extensions, originating from the GNU system. The BSD honours the special bits as an extension.

mknod c|b is compatible with Version 4 AT&T UNIX; mknod p with AT&T System V UNIX. u is accepted as an alias for c for compatibility with the GNU system; avoid it.

mknod appeared, fully formed, in Version 4 AT&T UNIX as mknod(VIII):

name [ ] [ ] major minor
Alongside the corresponding mknod(II) syscall.

It gained the usage in AT&T System V UNIX, alongside the inclusion of named pipes.

mkfifo was invented in IEEE Std 1003.2-1992 (“POSIX.2”) to provide a way to create named pipes from interactive sessions (mknod is not part of the standard), including -m for symmetry with mkdir(1); it appears in 4.3BSD-Reno and AT&T System V Release 4 UNIX.

July 7, 2024 voreutils 5a9f9f29