Use locate across external devices in Linux

By | December 5, 2010

By default, updatedb indexes only your root partition when run. To be able to extend locate‘s reach and get updatedb to index external devices such as USB harddisks and flash drives, edit the /etc/updatedb.conf file. Modify the following line:

PRUNEPATHS=”/tmp /var/spool /media”

so that it reads

PRUNEPATHS=”/tmp /var/spool”

This adds the devices mounted in the /media directory to the search path.

One thought on “Use locate across external devices in Linux

Leave a Reply

Your email address will not be published. Required fields are marked *