Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Anyone know how to make updatedb ignore 'hidden' paths? This isn't any kind of security issue; I just want updates to be faster. I've tried using the -n and -e flags with '.*' to no avail.

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

You can define directories that should be omitted in /etc/updatedb.conf. You can use regular expressions, citing GNU:

--prunepaths='path...'
Directories to omit from the database, which would otherwise be included. The environment variable PRUNEPATHS also sets this value. Default is /tmp /usr/tmp /var/tmp /afs. The paths are used as regular expressions (with find ... -regex, so you need to specify these paths in the same way that find will encounter them. This means for example that the paths must not include trailing slashes.

So change the following line in /etc/updatedb.conf:

PRUNEPATHS="/tmp /var/spool /media"

to:

PRUNEPATHS="/tmp /var/spool /media .*/\..*"

should work just fine ;-)

share|improve this answer
add comment

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.