On Mon 30 Jun 2003 at 09:15:11, Tony Vance said:
> 
> I've read that locate isn't for all situations.  I've read that locate
> doesn't search the hard drive, but rather a database that represents the
> hard drive.  Therefore, locate is only as accurate as the locate
> database is current.  Is this right?

That is correct.  Your system runs a command every night called
"updatedb" that searches through the hard drive and updates locate's
databse.

> When should I use the find command?

- When you are looking for a file that may not have existed last time
  updatedb ran
- When you are looking for a file within one subdirectory
- When you are looking from a file searching by something other than
  filename (like permissions or modification time).

> Are there other search commands?  If so what are their merits?

which is a wonderful command.  It searches the directories in your PATH
environment for an executable.  The PATH variable is what tells your
system where to find programs so that you don't have to type the full
directory name.  For instance, I type "mutt" and my system sees that
"/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin" are in my PATH.  It
searches each of those, and finds mutt in /usr/local/bin, so it runs it.
If I wondered where mutt was actually installed, I could type "which
mutt" and it would return "/usr/local/bin/mutt".

Another good search command is "apropos".  It searches through all the
manpages for pages about a certain command.  For instance, "apropos
bash" on my system returns:

bash (1)             - GNU Bourne-Again SHell
bashbug (1)          - report a bug in bash
builtins (1)         - bash built-in commands, see bash(1)
ispellconfig (8)     - Bash script to select a new ispell default dictionary.
rbash (1)            - restricted bash, see bash(1)
update-ispell-dictionary (8) - Bash script to select a new ispell default dictionary.

Which tells me all of the manpages that have information about bash.  I
can then do "man 1 builtins" if I want info about bash's builtins.

-- 
Soren Harward
[EMAIL PROTECTED]


______________________________________
Inflex Virus Scanner - installed on mailserver for domain @et.byu.edu
Queries to: [EMAIL PROTECTED]

_______________________________________________
newbies mailing list
[EMAIL PROTECTED]
http://phantom.byu.edu/cgi-bin/mailman/listinfo/newbies

Reply via email to