Skip to content

Instantly share code, notes, and snippets.

@jarrodhroberson
Forked from leogomes/find_in_jar.sh
Last active November 16, 2017 00:50
Show Gist options
  • Save jarrodhroberson/2f5fa1ac6beffaea8774 to your computer and use it in GitHub Desktop.
Save jarrodhroberson/2f5fa1ac6beffaea8774 to your computer and use it in GitHub Desktop.
bash and windows shell scripts to find classes in .jar files in a directory
# Windows (cmd) Command line version
forfiles /S /M *.jar /C "cmd /c jar -tvf @file | findstr /C:"$1" && echo @path"
# find things in a jar
# taken from http://www.unix.com/shell-programming-scripting/21551-jar-file-search.html
find . -name \*jar -print -exec jar -tvf {} \; | nawk '/YOURSEARCHSTRING/ || /jar/ {print} '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment