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
returns
./XYZ.xml
instead of
./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. |
|||||
|
|
Please try:
|
|||||||||
|
man find: Please note that you should quote patterns as a matter of course, otherwise the shell will expand any wildcard characters in them. – artdanil Jun 29 '12 at 17:50