Total Pageviews

Thursday, April 12, 2012

To find how many times a string occurs in all files

grep -c string *
to get only files that have one or more occurrence:
grep -c string * | grep -v :0
for multiple occurrences per line:
grep -o string * | wc -l

No comments:

Post a Comment