Skip to content

Instantly share code, notes, and snippets.

@mmattozzi
Created February 21, 2014 02:14
Show Gist options
  • Save mmattozzi/9127537 to your computer and use it in GitHub Desktop.
Save mmattozzi/9127537 to your computer and use it in GitHub Desktop.
Find longest java class name
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