Skip to content

Instantly share code, notes, and snippets.

@stes
Created September 12, 2018 12:42
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 stes/9a9b1f01efe7c4d61acd3a3ede888baa to your computer and use it in GitHub Desktop.
Save stes/9a9b1f01efe7c4d61acd3a3ede888baa to your computer and use it in GitHub Desktop.
Count lines of code in a software project, filtered by file extensions
#!/bin/bash
# Seen on https://coderwall.com/p/pfm8qg/counting-lines-of-code-in-a-python-project
# execute with file extension as argument, e.g.:
# $ ./loc.sh py
find . -name "*.${1}" -type f -exec grep . {} \; | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment