Using locate to find a file, instead of find

in «tip» by Michael Beard
Tags: , , , ,

locate is a good alternative to using find

As noted in the finding the Tools/scripts subdirectory in stackoverflow:

This command

  $ locate "Tools/scripts/diff.py"

will find the location of the file if it's installed. This depends on the database generated regularly by the updatedb command (this usually runs as a cron job, but can also be invoked manually)

It works pretty nice though. I'd seen it before, but always skipped it, as I wanted to use find, but this is a really good thing instead.

General Notes

I found on the Mac, it there is no updatedb command but it may run automatically, once the database is created. I didn't have to do anything to get the initial find work, other than wait a bit. So, ... We'll see.