Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jesugmz/c54a56539918a3fa9472a85518ae3df1 to your computer and use it in GitHub Desktop.
Save jesugmz/c54a56539918a3fa9472a85518ae3df1 to your computer and use it in GitHub Desktop.
Count all the lines of given directories recursively

Count all the lines of given directories recursively

In this example want to count the number of lines of every PHP file in two directories, dir-1 and dir-2/subdir:

find {dir-1,dir-2/subdir} -name '*.php' | xargs wc -l

The output is the sumarize of each line:

3212 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment