a/
find .
means, "find (starting in the current directory)." If you want to search the whole system, use find /
; to search under /System/Library
, use find /System/Library
, etc.
b/
It's safer to use single quotes around wildcards. If there are no files named *.jdk in the working directory when you run this, then find
will get a command-line of:
find . -name *.jdk
If, however, you happen to have files junk.jdk
and foo.jdk
in the current directory when you run it, find
will instead be started with:
find . -name junk.jdk foo.jdk
… which will (since there are two) confuse it, and cause it to error out. If you then delete foo.jdk
and do the exact same thing again, you'd have
find . -name junk.jdk
…which would never find a file named (e.g.) 1.6.0.jdk
.
What you probably want in this context, is
find /System -name '*.jdk'
…or, you can "escape" the *
as:
find /System -name \*.jdk