Skip to content

Instantly share code, notes, and snippets.

@diofeher
Created October 8, 2011 23:33
Show Gist options
  • Select an option

  • Save diofeher/1273059 to your computer and use it in GitHub Desktop.

Select an option

Save diofeher/1273059 to your computer and use it in GitHub Desktop.
Count lines of directory
#!/bin/bash
num=0
for arq in ` find . -type f -name "*.html" -o -name "*.css" -o -name "*.conf" -o -name "*.js" -o -name "*.xml" -o -name "*.txt" -o -name "*.py"`
do
tmp=`wc -l $arq | awk '{print $1}'`
num=`expr $num + $tmp`
done
echo Total: $num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment