Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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:

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"


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

should work just fine ;-)

share|improve this answer

Your Answer


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.