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.

Free Dummies Books
Continuous Engineering


  • What continuous engineering is
  • How to continuously improve complex product designs
  • How to anticipate and respond to markets and clients
  • How to get the most out of your engineering resources

Get your free book now

Sponsored by IBM

Free Dummies Books
Service Virtualization

Learn to:

  • Define service virtualization
  • Select the most beneficial services to virtualize
  • Improve your traditional approach to testing
  • Deliver higher-quality software faster

Get your free book now

Sponsored by IBM