Hi All,

> "locate" tells you where the file you want is (similar to find).  what
> makes it so cool is that it searches a database, not the actual disk(s).
> this means it is fast, instantaneous for me actually :) The only problem
> though is that that database gets out of date with where your files
> actually are as you move/delete files.  To update the databaes, run
> "updatedb".  I have a cron job set up to run that several times throughout
> the day so it is automatically in sync.  "man locate" for specifics.
>
> A similar command is "whereis" which locates specifically binaries, man
> pages and source files, by looking i belive in your paths and some common
> directories where these are kept.
>
> of course, if you need a more sophisticated and powerful search, "find"
> is your friend, but the man page will do much better explaining it than i
> can.

Thanks for those useful tips, Joshua!

If I can add a couple of things:

* Another useful command is 'which', i.e 'which <command>', that will tell you
if the command is an alias or a file, and if it is a file, where it is.

* The syntax for 'find' that I often use is 'find <start-directory> -name
<filename> -print'.
The 'find' command searches the start-directory and then all subdirectories.

Regards, James.

> "Some scientists claim that hydrogen, because it is so plentyful, is the
> basic building block of the universe. I dispute that. I say there is more
> stupidity than hydrogen, and that is the basic building block of the
> universe."
>    - Frank Zappa

P. S. I like the signature!

Reply via email to