Finding files in side a jar

List all files in jar-file-name.jar whose name is start with “SomeFileName”

jar -tvf jar-file-name.jar | grep "SomeFileName"

List all files in a jar order by size

jar -tvf jar-file-name.jar | sort -n -r

List all the classes contains the class name with package structure.

find filePath -name '*.jar' | xargs -I @ jar -tvf @ | grep ClassName
find filePath -name '*.jar' | xargs -I @ jar -tvf @ | grep /ClassName

Search and print the jar names and if the class exists then print the class name.

find filePath -name '*.jar' | while read F; do (echo $F; jar -tvf $F | grep ClassName.class) done

Search and print the jar name if the class exsists then prints the class name. (exact match only)

find filePath -name '*.jar' | while read F; do (echo $F; jar -tvf $F | grep /ClassName.class) done

#bash, #find, #jar, #search