locate is a nice tool to quickly find files by name because it builds a database of all files and searches it instead of the filesystem. I know OSX has Spotlight, but it’s graphical, has some indexing issues sometimes, and the command-line client is clumsy. I prefer simpler UNIX tools. Some more info in the Arch wiki.
I’m mostly interested in locating my own files, so the database will be stored in the home directory and updated from my user, not root.
I’m using glocate (GNU locate) from the findutils brew package because it’s newer and has more features:
It will run gupdatedb with a low priority when you load it and then every 24 hours (86400 seconds). It prints the start date just so that I can verify the service works by checking the /tmp/updatedb.out file. Load it with: