How can I count the number of lines matching a pattern returned from a linux command
I want the number of lines returned beginning with 'foo' , so if I pipe the output to grep will this work?
cat | grep -c ^foo
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community