How do I find files that do not contain a given string pattern?

后端 未结 16 1320
半阙折子戏
半阙折子戏 2020-11-28 17:42

How do I find out the files in the current directory which do not contain the word foo (using grep)?

16条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 18:01

    find *20161109* -mtime -2|grep -vwE "(TRIGGER)"

    You can specify the filter under "find" and the exclusion string under "grep -vwE". Use mtime under find if you need to filter on modified time too.

提交回复
热议问题