Locate, Find, Which - How do I launch an index/scan command for these utilities?

Find does not need an index, and traverses the disk every time you run it. Example

$ find / -name "*mynewprogram*"

locate and variants need index files, but they work -really- faster. 'locate' is from GNU findutils. 'slocate' was recommended up to etch; it was a more 'secure' version of locate, users will not see files that they do not have acess to. 'mlocate' is recommended in lenny and newer, mlocate has a more efficient indexing mechanism.

$ sudo updatedb  # to update the index.
$ mlocate  mynewprogram

which searches your $PATH for the binary name you give. No need for an index.

$ which touch
/usr/bin/touch

If you want to see a package's installed files, use this

dpkg -L coreutils

To see which package installed a specific file

$ dpkg -S /usr/bin/touch
coreutils: /usr/bin/touch

try

updatedb -v

[ -v to be sure it actually works ;-]

i also use sometimes

cd /whatever/is/the/path
find .|grep -i somePatternMatchingWhatIneed

Use the find command.

Here are some examples and syntax documents. Unfortunately I can't add hyperlinks yet :(.

http://linux.about.com/od/commands/a/blcmdl1_findx.htm

http://linux.about.com/od/commands/l/blcmdl1_find.htm

Tags:

Linux

Search

Find