Files
tldr/pages.zh/common/mkfifo.md

20 lines
449 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# mkfifo
> 创建 FIFO命名管道
> 更多信息:<https://www.gnu.org/software/coreutils/mkfifo>。
- 在给定路径创建一个命名管道:
`mkfifo {{path/to/pipe}}`
- 通过命名管道发送数据并将命令发送到后台:
`echo "{{Hello World}}" > {{path/to/pipe}} &`
- 通过命名管道接收数据:
`cat {{path/to/pipe}}`
- 实时共享你的终端会话:
`mkfifo {{path/to/pipe}}; script -f {{path/to/pipe}}`