简体   繁体   中英

Find files not containing search string

Is there a way to find out files of a type ,NOT containing a particular key-word.
This is both -
1. under a particular directory
2. Under and particular directory and all underlying subdirectories.
Help is appreciated

Read the documentation of GNU grep

You probably want

grep -L word file*

or

grep -Lr word dir/

You could achieve this by something like

grep -L keyword $( find /start/path -type f )

You may need GNU grep for -L .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM