Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Counting the number of textual files and their number of lines
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
You can’t perform that action at this time.