Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

4 Answers

up vote 8 down vote accepted

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
share|improve this answer
Thanks, your recommendations worked. I didn't know about mlocate, and it wasn't there on the default Lenny install... neither was locate, but apt-getted 'locate' and didn't know how to update/index the db. What's the difference between mlocate and locate? (they both seem pretty similar) – l0c0b0x May 22 '09 at 15:20
updated the answer – hayalci May 23 '09 at 23:23

try

updatedb -v

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

i also use sometimes

cd /whatever/is/the/path
find .|grep -i somePatternMatchingWhatIneed
share|improve this answer

Use the Find command.

Here are some examples and syntax documents. Unfortunately I cant add hyperlinks yet :(

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

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

share|improve this answer

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:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.