Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sum the number of lines in each file of a folder

Run this command to sum the number of lines in each file of a folder

find . -maxdepth 1 -type f -exec wc -l {} + | awk '{sum+=$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.