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'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.
There are 8 alternatives - vote for the best!
grep -o puts each occurrence in a separate line
If you can do better, submit your command here.
You must be signed in to comment.