Skip to content

Instantly share code, notes, and snippets.

@vikynandha-zz
Last active December 25, 2015 16:19
Show Gist options
  • Select an option

  • Save vikynandha-zz/7005219 to your computer and use it in GitHub Desktop.

Select an option

Save vikynandha-zz/7005219 to your computer and use it in GitHub Desktop.
Count lines of js code in the given (or current) directory, excluding blank lines
if [ $# -eq 0 ]
then wd=.
else wd=$1
fi
find $wd -name "*.js" -not -path "*/tests/*" | xargs grep -v '^[ ]*$' | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment