Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

For instance, I don't want either program to find files that end in *.pyc. I'm sure I can do this somehow using regexes or globs, but is there a way to make locate just ignore the files altogether? It's highly doubtful that I would ever want to search for a pyc file.

share|improve this question

In updatedb.conf, uncomment the PRUNENAMES line and add the extension .pyc. On my Ubuntu system by default it reads:

# PRUNENAMES=".git .bzr .hg .svn"

Change it to

PRUNENAMES=".git .bzr .hg .svn .pyc"

share|improve this answer
typo -- second PRUNENAMES has a pair of doublequotes at the beginning. – quack quixote Oct 2 '09 at 16:23
Fixed-thanks, quack. – CarlF Oct 3 '09 at 2:10
As it turns out, PRUNENAMES only works for directories, not for file names. – Jason Baker Nov 17 '09 at 15:26

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.