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.

Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl

Sign up and watch now

Sponsored by Skybot