Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eddy-Barraud/1b0c34705953166da9badfd0753221bb to your computer and use it in GitHub Desktop.
Save Eddy-Barraud/1b0c34705953166da9badfd0753221bb to your computer and use it in GitHub Desktop.
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