I am running the following command, but it is not performed recursively:
find . -name *.java
I know there are java files further down in the current directory but it is performing the
find on the current directory only. I am using OS X, 10.9.
The problem is, you didn't quote your
Without the quotes, the shell interprets
which would obviously list the file in the current directory only (unless you happen to have some similarly-named files further down the tree).
Quoting prevents glob expansion and passes the command line to
Incidentally, if the glob had failed to match (no
I had a situation similar where I was surrounding the -name value in quotes, but still wasn't getting all of the find hits that I was hoping for. I conjectured that it was because of symlinks and sure enough that was the case. If you want to force find to search through symlinks you can modify the command to the following: