这只是我无法解决的好奇心(尝试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)