in reply to Count file lines in a directory tree
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Count file lines in a directory tree
by sauoq (Abbot) on Nov 09, 2005 at 02:12 UTC | |
by Aristotle (Chancellor) on Nov 09, 2005 at 02:25 UTC |