Skip to content

Instantly share code, notes, and snippets.

@rm-code
Last active January 15, 2017 04:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rm-code/17f1987fddcd937a04d0 to your computer and use it in GitHub Desktop.
Bash one-liners to count lines of code.
# Only returns the total lines of code.
# Remove the tail call to show a more verbose output.
wc -l $(find . -name '*.lua') | tail -1
# Add more files as parameters.
wc -l $(find . -name '*.lua' -or -name '*.sh' ) | tail -1
# This would return the lines of code of all .lua files in your repository.
# Simply exchange .lua with the extension you want to search for.
wc -l $(git ls-files | grep -e '.*\.lua' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment