Created
February 21, 2014 02:14
-
-
Save mmattozzi/9127537 to your computer and use it in GitHub Desktop.
Find longest java class name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Search one project: | |
find . | grep -v Test | perl -nl -e 'if ($_ =~ /\/((\w+)\.java)/) { print length($2) . " $1"; }' | sort -nr | head -20 | |
Search many projects and include project name in list: | |
find . -name '*.java' | grep -v Test | perl -nl -e 'if ($_ =~ /^\.\/(\w+)\/.*\/((\w+)\.java)$/) { print length($3) . " $2 - $1"; }' | sort -nr | grep -v mice | head -20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment