Skip to content

Instantly share code, notes, and snippets.

@deybhayden
Last active May 11, 2018 20:26
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 deybhayden/0a9715a383252f052589dd4df0667a75 to your computer and use it in GitHub Desktop.
Save deybhayden/0a9715a383252f052589dd4df0667a75 to your computer and use it in GitHub Desktop.
Function to count lines of code in a passed file type
# Function to count lines of code in a passed file type
# use git ls-files to ignore any of the same file type passed in that we don't care about
count() {
git ls-files "*.$1" "**/*.$1" | xargs grep -H -c '[^[:space:]]' | sort -nr -t":" -k2 | less
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment