A fifo(7), or "named pipe" is a character device, that when is opened by one process for reading, and another for writing, allows inter-process communication.

This is similar to how you can use a pipe(7), but does not require both processes to be started by a common ancestor.

This can be demonstrated in two terminals. In the first run:

$ mkfifo test.fifo
$ cat test.fifo

In the second run:

$ cat >test.fifo

Now when you enter lines of text into the second terminal, they will be output on the first.

fifos also have another trick up their sleeves, as when a process opens a fifo, it will block until the other end has been opened.

Using this ephemeral-launch script, we can start an echo server on a random port, and have a client block until the server is ready, and also report which port should be used.

In one terminal run:

$ mkfifo test.fifo
$ ephemeral-launch --port-file test.fifo cat

In a second terminal run:

$ port="$(cat test.fifo)"
$ nc "$port"

Now when you enter lines of text into the second terminal, it will echo them back.

Because the processes block on the open, the cat test.fifo in the second terminal will block until the ephemeral-launch process has bound the port and written it out to the fifo.