小编tho*_*mie的帖子

为什么“tail -f ... | tail”无法产生任何输出?

为什么以下命令不产生任何输出?

$ tail -f /etc/passwd | tail
Run Code Online (Sandbox Code Playgroud)

阅读有关缓冲后,我尝试了以下无济于事:

$ tail -f /etc/passwd | stdbuf -oL tail
Run Code Online (Sandbox Code Playgroud)

请注意,以下确实会产生输出:

$ tail /etc/passwd | tail
Run Code Online (Sandbox Code Playgroud)

这样做也是如此:

$ tail -f /etc/passwd | head
Run Code Online (Sandbox Code Playgroud)

我使用的是尾部版本 8.21(GNU coreutils)。

pipe tail

37
推荐指数
3
解决办法
1万
查看次数

标签 统计

pipe ×1

tail ×1