Skip to content

Instantly share code, notes, and snippets.

@diegoperini
Created November 17, 2015 00:07
Show Gist options
  • Save diegoperini/c853687fc7263e2a445f to your computer and use it in GitHub Desktop.
Save diegoperini/c853687fc7263e2a445f to your computer and use it in GitHub Desktop.
count-lines
#!/bin/sh
#
# Simple shell script to count number of lines in every
# file with given file extension in current directory.
#
# Usage:
# ./count-lines.sh 'js'
# ./count-lines.sh 'cpp'
find . -name '*.'$1 | xargs wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment