Created
July 4, 2019 19:18
-
-
Save carlok/912dcd3a2a46b7ed9c2bc83536b34afe to your computer and use it in GitHub Desktop.
Counting the number of textual files and their number of lines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find A_LIST_OF_FOLDERS_AND_FILES -type f -exec grep -Iq . {} \; -print | wc -l | |
# A_LIST_OF_FOLDERS_AND_FILES => use the previous command as: find a b.txt c where a and c are directories or files | |
for a in $(find src -type f -exec grep -Iq . {} \; -print); do wc -l $a; done | awk '{split($0,a," "); sum += a[1]} END {print sum}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment