| 12:31 am on Mar 17, 2010 (gmt 0)|
First of all a warm welcome to WebmasterWorld joecarter!
Locate doesn't find files based on their basename, but based on their full path stored in a local database which is periodically compiled with the updatedb task. The regular expression parameter you pass to the locate tool must match a whole line in the database. vmware*.pl doesn't match any of the entries, because they are all full paths beginning with a slash. Therefore a wildcard at the beginning is necessary. It matches the path part of the file location.
You can also use real-time searching where you can specify a basename only. For example:
find / -name "vmware*.pl" -print
This command performs a search through the whole directory structure instead of a precompiled database and will therefore take more time than a search with the locate utility.
| 1:44 pm on Mar 17, 2010 (gmt 0)|
Thanks Lammert. This is crystal clear.
Nice would be if was this clear in the "man" online :-)
| 1:48 pm on Mar 17, 2010 (gmt 0)|
this might also help.
from the man page:
whereis locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form .ext, for example, .c. Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in a list of standard Linux places.
| 8:11 pm on Mar 17, 2010 (gmt 0)|
The problem with whereis is, that it was desigined in the old Unix times when disk access was a time consuming operation. It therefore only searches in some default system paths like /bin, /etc and /usr/*. Files in one of the user directories or in an application specific directory can't be found with whereis.
| 9:12 pm on Mar 17, 2010 (gmt 0)|
it's not a problem - just one more tool in the bag.
i've been on servers where one or the other is not installed or the path where one is located is not specified in $PATH so you can sometimes use another one instead of or to find the other.
| 1:17 pm on Mar 18, 2010 (gmt 0)|
Thanks all. I must say after jsut trying the whereis cmd I find it unclear too (which is how this thread started). if I type whereis 'Red Hat-release' I get a response:
on the next line. what does this mean .. well actually it means the file is not there ... pretty unusable feedback!