[Will list the files that does not contains the word in the current directory]
find . -type f \! -exec grep -q "word" {} \; -print
find . -type f | while read file
do
grep "word" $file > /dev/null
[ $? -ne 0 ] && echo $file
done
[List of all files in the current dir]
find . -type f
find . -type f | xargs grep -lv "word"
[List files containing the word]
find . -type f -exec grep -q "void" {} \; -print
[List files and all occurrence of word ]
grep -r "void" .
No comments:
Post a Comment