Grep:获取所有没有匹配行的文件 [英] Grep : get all file that doesn't have a line that matches
本文介绍了Grep:获取所有没有匹配行的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有很多包含多行的文件,并且在大多数情况下,其中一行包含某种模式.我想列出所有没有这种模式行的文件.
I have a lots of files with multiple lines, and in most case, one of the lines contain a certain pattern. I would like to list every file that does not have a line with this pattern.
推荐答案
使用-L"选项以获得没有模式的文件.根据手册页:
Use the "-L" option in order to have file WITHOUT the pattern. Per the man page:
-L, --files-without-match
-L, --files-without-match
抑制正常输出;而是打印通常不会打印输出的每个输入文件的名称.扫描将在第一场比赛时停止.
Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match.
这篇关于Grep:获取所有没有匹配行的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文