Skip to content
Advertisement

Use wc on all subdirectories to count the sum of lines

How can I count all lines of all files in all subdirectories with wc?

JavaScript

man wc suggests wc -l --files0-from=-, but I do not know how to generate the list of all files as NUL-terminated names

JavaScript

did not work.

Advertisement

Answer

You probably want this:

JavaScript

If you only want the total number of lines, you could use

JavaScript
Advertisement