grep -roh aaa . | wc -w
Grep recursively all files and directories in the current dir searching for aaa, and output only the matches, not the entire line. Then, just use wc to count how many words are there.
took from s.o. http://stackoverflow.com/a/6135712
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.