Some time ago I’ve posted about using multiple
-exec options for
find command which can be used to find in what JARs particular class lies. Below you can find enriched and more intuitive/detailed solution for finding your class in a bunch of JARs:
If you’re using BASH find and want to find files which are named differently than the given pattern, you can use the following syntax:
find . -type f ! -iname "*.class"
The above command will find all files in the current directory (and subdirectories) which have the extension different (exclamation mark) from “class” (case insensitive).
You can also use conditional operations to build slightly more complicated commands, like:
find . -type f ! \( -iname "*.class" -o -iname "*.jar" \)
The above command uses the OR operation to find all files in the current directory (and subdirectories) which have extension different than “class” or “jar”. Don’t forget about the parentheses escaping!
Didn’t need this feature before today, but I guess it might be quite handy.