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
find -iname '*.xml'
Otherwise, your shell expands
XYZ.xml, and the command that actually gets executed is
find -iname XYZ.xml
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
scp, etc.) you need to quote them so the shell won't try to expand them itself.
You need to quote your argument like this:
find ./ -name '*.xml'
so that it gets passed to find instead of being expanded by the shell, then passed to find as the expanded version.
This works on Solaris 10:
find /directory-to-search/* -prune -name "*gz"
find ./ -name *.xml