Total Pageviews

Wednesday, May 14, 2014

Count 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