Search This Blog

Count lines of Java source code

find . -type f -name "*.java" | xargs cat | grep [alnum{}] | wc -l
or shell script could be:
#!/bin/bash

[[ -z $1 ]] && dir=. || dir=$1

find $dir -type f -name "*.java" | xargs cat | grep [alnum{}] | wc -l

No comments:

Post a Comment