Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell Unix:限制DIFF命令的输出行数_Shell_Unix - Fatal编程技术网

Shell Unix:限制DIFF命令的输出行数

Shell Unix:限制DIFF命令的输出行数,shell,unix,Shell,Unix,这是一个相当低级的问题,但如何将diff的输出限制为例如5行 我正在运行bourne shell,我知道diff-c和diff-c5,但这些命令都不适合我。还有其他方法吗?在NetBSD上,您使用的是哪种差异,我可以使用以下方法限制它: % diff ~/.zshrc* | grep '[<>]' | head -5 < setopt autocd interactivecomments < CASE_SENSITIVE="true" < DISABLE_LS_CO

这是一个相当低级的问题,但如何将diff的输出限制为例如5行


我正在运行bourne shell,我知道diff-c和diff-c5,但这些命令都不适合我。还有其他方法吗?

在NetBSD上,您使用的是哪种差异,我可以使用以下方法限制它:

% diff ~/.zshrc* | grep '[<>]' | head -5
< setopt autocd interactivecomments
< CASE_SENSITIVE="true"
< DISABLE_LS_COLORS="true"
< #plugins=(git)
> plugins=(git)

希望有帮助

谢谢你的帮助!