1

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

a.py
a.pyc
a.py~

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 '15 at 3:11
  • when i said binaries/compiled files, i meant .pyc files and not .py scripts – user93868 May 11 '15 at 3:13
  • There are several implementations of locate and they have different capabilities. Which one are you using? (e.g. GNU locate, mlocate, …) – Gilles 'SO- stop being evil' May 11 '15 at 21:14
0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy