grep: Searching for Words

A command to help you find a specific word or a sentence in a file.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

grep -c 'searchstring' does

Anonymous's picture

grep -c 'searchstring' does not give you the TOTAL count of the searchstring in a file. It just gives you the TOTAL NUMBER OF LINES "containing" the search string.