I'd like to configure locate to always exclude specific file types.

For example, I would like to exclude ".pyc" ".class" "~" etc.

link|improve this question

71% accept rate
feedback

3 Answers

up vote 1 down vote accepted

This is a duplicate question from superuser.com:

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"
link|improve this answer
feedback

look at /etc/updatedb.conf

link|improve this answer
feedback

Hideous hack though it may be, you could always use grep:

locate foo | grep -v ".pyc$" | grep -v ".class$"

and chain as necessary.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.