Imagine a source tree. There are xml files everywhere.
But since there is a XYZ.xml at the root of this tree it won't find my xml files.
find -iname *.xml
./XYZ.xml ./a/b/c/bob.xml ./b/d/top.xml
Otherwise, your shell expands
The reason it works if there are no XML files in the current directory is that shells generally leave wildcards unexpanded if they don't match anything. In general, any time you want wildcards to be expanded by a program other than the shell (e.g. by
You need to quote your argument like this:
so that it gets passed to find instead of being expanded by the shell, then passed to find as the expanded version.