Skip to content

Instantly share code, notes, and snippets.

@kurtcebe
Last active December 19, 2015 23:59
Show Gist options
  • Save kurtcebe/6038510 to your computer and use it in GitHub Desktop.
Save kurtcebe/6038510 to your computer and use it in GitHub Desktop.
Script to find which jar file contains a given class, searching through jar files in a directory hierarchy.
#!/bin/bash
for i in `find . -name '*.jar'`; do jar -tf "$i" | grep $1 | xargs -I{} echo "$i : {}" ; done
# if 'jar' is not in the path, you may use 'unzip -l' instead of 'jar -tf'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment