I am using the following Linux command to recursively count lines of text files in a folders structure:
find . -name '*.txt' | xargs -d '\n' wc -l
This outputs all found files and their number of lines:
86 ./folder1/folder11/folder111/file1.txt
67 ./folder1/folder11/folder112/file2.txt
7665 ./folder1/folder11/folder113/file3.txt
..., etc.
1738958 total
There are a total of 24k+ files. The number of lines for each file are correct and all files there are possessed. But the total number of lines is not correct. Even for a sub-folder of this structure the total number of lines is much bigger. For example:
cd folder1/folder11
find . -name '*.txt' | xargs -d '\n' wc -l
gives at the end 23M lines:
22535346 total
The total number of all lines should be > 100M, not 1.7M. What I am missing here?