7

How do I re-scan my drive so my 'search utilities' are able to find a new file on my system?

I'm having a tough time googling HOW TOs for launching an index/scan command to any of this applications. I mostly use: 'find' and 'locate', but thought it would be a good idea to know about other search apps and their index/scan commands (Sorry, don't know what to best call it: index or scan for scanning new files on the system).

  • My problem: I install or download a new file to the system but don't know where.
  • My Need: To scan my drive (preferably by folder, but i'm willing to live with a full scan)
  • My OS: Linux Debian (Lenny)

Thank you!

weegee
  • 143
l0c0b0x
  • 12,187

4 Answers4

12

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
hayalci
  • 3,721
2

try

updatedb -v

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

i also use sometimes

cd /whatever/is/the/path
find .|grep -i somePatternMatchingWhatIneed
pQd
  • 30,537
2

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

Elijah Lynn
  • 161
  • 6
  • 17
2

If you want to search inside the contents of a file, not just on the filename, then you need a dedicated daemon that will index everyfile as it's created/modified and provide a fast search to that index.

You might want to try:

Amandasaurus
  • 33,461