I was using find to search for a file on my machine like so:

find / -name version-1.0.*

and the result was just one file in my home directory, version-1.0.23. However, if I ran the following:

find / -name version-1.0.1*

the result was /data/somelongpath/version-1.0.19.

Why would this second result be omitted from the results in the first case?

link|improve this question

feedback

1 Answer

up vote 6 down vote accepted

You have a file that matches the glob in the current directory, and your shell is globbing it. Escape the glob.

find / -name 'version-1.0.*'
link|improve this answer
Extra info for readers: "globbing" refers to the shell expanding wildcards into the full filename or a list of filenames. The shell does this before executing the program. – Zan Lynx Jul 29 '11 at 22:30
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.