You mean this?
find -name '*.p[lm]' -print0 | xargs -r0 cat | wc -l
:-)
Update: I was using the unnecessarily longwinded find \( -name '*.pm' -o -name '*.pl' \)
Update: to make this output the number of files, the easiest approach is a bit of Perl:
find -name '*.p[lm]' -print0 \ | perl -00000pe'++$a;END{print STDERR "Files: ",$a||0,", lines: "}' \ | xargs -r0 cat | wc -l
Makeshifts last the longest.
In reply to Re: Count file lines in a directory tree
by Aristotle
in thread Count file lines in a directory tree
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |