I'm running a find . -name pattern to find some files, and I'd like to elegantly get the total number of lines in these files.
How can I achieve that?
|
feedback
|
|
If your version of
which will give you per-file counts as well as a total. If you want only the total:
Another option for versions of
| |||
|
feedback
|
|
Unfortunately the output of :
inserts extra lines. In order to get a reliable line count you should do:
This way you handle spaces correctly, get a line count for each file, and the total line count, faster and in style!!! | |||||
feedback
|
|
Untested, but how about something like:
| |||
|
feedback
|
Takes each file and Or, [untested] strange filename safe:
| ||||
|
feedback
|