Skip to content

Instantly share code, notes, and snippets.

@yauhen-info
Created May 14, 2014 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yauhen-info/6f1bc165b3c6eb5f73dc to your computer and use it in GitHub Desktop.
Save yauhen-info/6f1bc165b3c6eb5f73dc to your computer and use it in GitHub Desktop.
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