What's the difference between which and whereis ?
|
migrated from stackoverflow.com Sep 12 '09 at 22:41
|
How about learning about
Basically, I rarely use
|
|||||||||||
|
|
|
|||||||||
|
|
Quoting their man pages : whereis :
For instance :
ie, the "php" executable, and some other stuff (like man pages).
For instance :
ie, only the "php" executable. |
|||
|
|
|
which search for executables in the directories specified by the environment variable PATH. And if found out, the full pathname of this executable will be printed.
whereis search for executables, source files, and manual pages using a database built by system automatically.
But it seems that whereis and locate don't use the same database. When I installed a software and then used whereis and locate immediately to search for this software. The result is that whereis could find out some files related to this software while locate couldn't. Do they really use different database? How the database work? --Well, how about refuse to be a pedant? :) |
|||
|
|
