用grep查找连续的单词

时间:2015-09-14 19:58:19

标签: grep

我已经检查过这个主题,在文本文件中找到两个单词:How to combine two search words with "grep" (AND)

但现在我想知道是否有可能检查文件中的连续时间。例如:

grep -ilZ" not" file.txt | xargs -0 grep -il"确定"

在file.txt中我有"我不确定"。

我该怎么办?

非常感谢你。

1 个答案:

答案 0 :(得分:0)

只需grep -il "not sure" file.txt即可解决您的问题。