I have installed ubuntu as part a college course and I would like to familiarise further with the command line.

I have ton's of text files which I would like to search for specific phrase but I don't know out to count them.

Is there a direct way to do that?

Many thanks

1 Answer 1


I don't know the direct way but I do it like below.

grep -rl <pattern> <folder>  | wc -l

use the manual page to identify the purpose if each option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .