Skip to content

Instantly share code, notes, and snippets.

@marcoshack
Created July 13, 2010 20:39
Show Gist options
  • Select an option

  • Save marcoshack/474490 to your computer and use it in GitHub Desktop.

Select an option

Save marcoshack/474490 to your computer and use it in GitHub Desktop.
Find Java class (bash script)
#!/bin/bash
CLASS_NAME=$1
if [[ $CLASS_NAME == "" ]]; then
echo -e "\nUsage: $0 CLASS_NAME\n"
exit 1
fi
for i in `find . -name *.jar`; do
jar tf $i |grep $CLASS_NAME > /dev/null
if [[ $? == 0 ]]; then
echo $i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment