Skip to content

Instantly share code, notes, and snippets.

@jarrodhroberson
Created March 12, 2013 16:52
Show Gist options
  • Save jarrodhroberson/5144645 to your computer and use it in GitHub Desktop.
Save jarrodhroberson/5144645 to your computer and use it in GitHub Desktop.
A short Bash script to delve through a directory of .jar files and find the ones that contain a given package or class.
#!/bin/sh
find . -name '*.[jwes]ar' | while read LINE; do grep -q $1 "$LINE"; if [ $? -eq 0 ];then echo "$LINE"; jar tvf "$LINE" | grep $1;echo;fi;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment