commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
grep -o puts each occurrence in a separate line
There is 1 alternative - vote for the best!
grep's -c outputs how may matches there are for a given file as "file:N", cut takes the N's and awk does the sum.
If you can do better, submit your command here.
You must be signed in to comment.