I would like to run the following unix command in perl:
grep -r "some_word" /path/to/directory | wc -l
(The goal is to see how many times does "some_word" appear in a directory and all its inside-folders/files.
What is Perl's equvalence? I tried looking here, but not enough examples for what I need.
For example, this is what I have:
/tmp/a/text1:
"This is a big text"
/tmp/a/text2:
"This is another text"
/tmp/b/text3:
"One more big text"
/tmp/a/a2/text4:
"Last big text"
and I would like to be able to run the grep command and I shall get:
grep_command_in_perl -r "big" /tmp/ | wc -l
3
Thanks! :)
*** EDIT: *** (I don't understand why the question was closed... What kind of expectation was expected from me? Is "grep -r "some_word" /path/to/directory | wc -l" not enough to understand what I'm asking?