Running locate command with a file name returns multiple entries as,


Obviously, i am not looking for binaries/compiled files. I tried to configure locate command to ignore files that has pattern *.pyc, *.py~. Man page shows, locate command doesn't have globbing option.

How can one configure locate command to ignore files that match a pattern?

  • I am confused, since when did python scripts become binaries/compiled files?
    – jas-
    May 11, 2015 at 3:11
  • when i said binaries/compiled files, i meant .pyc files and not .py scripts
    – user93868
    May 11, 2015 at 3:13
  • 1
    There are several implementations of locate and they have different capabilities. Which one are you using? (e.g. GNU locate, mlocate, …) May 11, 2015 at 21:14

1 Answer 1


Have you tried 'man locate'? If you were to examine the manual for the locate tool you will see that using '\' disables globbing and forces a literal pattern match.

You must log in to answer this question.