• Post Reply Bookmark Topic Watch Topic
  • New Topic

grep question  RSS feed

 
Jason Kretzer
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do I have to use to count the number of records that a grep command returns?
thanks,
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The -c argument should suppress the output and give you a count. See "grep --help", "man grep", or click here.
 
sonny kher
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or u could pipe it to |wc -l
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!