小编Yek*_*eke的帖子

在stdout上打印n行"command's --help"

这只是我无法解决的好奇心(尝试sed,awk,tail,head等).

这有效:

$ ls --help | head -n 2
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Run Code Online (Sandbox Code Playgroud)

为什么使用其他命令它不起作用?

$ tree --help | head -n 2 
Prints the whole --help! not just the first 2 lines!
Run Code Online (Sandbox Code Playgroud)

bash shell stdout

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

标签 统计

bash ×1

shell ×1

stdout ×1