jarrodhroberson
3/12/2013 - 4:52 PM

A short Bash script to delve through a directory of .jar files and find the ones that contain a given package or class.

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