How to count line numbers recursively in a directory?
HOw do i get the total line count in ALL the files in a particular diretory recursively?
I tried cat * | wc -l somehow this doesn't go into subdiretories and it doesn't ignore non-text files. |
Quote:
1) cat it a non recursive program... 2) cat doesn't distinguish between ascii and binary files. why should it? you would want to possibly do a find on that directory (which IS recursive) and then use those results as the input to a for loop, which would include a 'test' command to check what kind of file it is. |
All times are GMT -5. The time now is 08:52 PM. |