Posted By

micmath on 08/21/07


Tagged

linux


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

mabridge
alexxx
Leech


Find a file


 / Published in: Bash
 

  1. # This can be slow...
  2. find / -name my_lost_file 2>/dev/null
  3.  
  4. # This is preindexed so is faster...
  5. locate my_lost_file
  6.  
  7. # If index is out of date, it needs updating.
  8. # This is also slow...
  9. locate -u

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: capitalist on August 21, 2007

To update locate on Mac/darwin you'll need to sudo /usr/libexec/locate.updatedb

Cheers!

You need to login to post a comment.