Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get matched words, Linux command line
The grep -o command will only display matched words and the wc -c command will display the word counts from a text file barfoo.txt:
grep -o -w 'foo' barfoo.txt | wc -w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.