Unix Command to List files containing string but *NOT* containing another string

后端 未结 6 1730
春和景丽
春和景丽 2021-01-30 22:01

How do I recursively view a list of files that has one string and specifically doesn\'t have another string? Also, I mean to evaluate the text of the files, not the filenames.

6条回答
  •  孤街浪徒
    2021-01-30 22:37

    These answers seem off as the match BOTH strings. The following command should work better:

    grep -l  * | xargs grep -c  | grep '\:0'
    

提交回复
热议问题