Consectetur enim pariatur, mollit et id quis in proident, dolore veniam, eiusmod dolor ullamco officia voluptate qui est esse reprehenderit dolor aute ut adipisicing aliquip. Pariatur, in excepteur magna exercitation laboris ut aliqua, id est labore enim nulla amet, ut ad aute in dolor ea officia sed non deserunt anim
Yeah, this will be replaced... But please enjoy the search!
As you might be aware of there is an entire world below the pretty window manager in Mac OS X. It has many names, I usually refer to it as the console.
However, finding and managing files in it can be a hassle unless you are aware of a large variety of commands. This guide will describe the 'locate' command.
The manual sais 'locate -- find filenames quickly' and 'The locate program searches a database for all pathnames which match the specified pattern.' which is very true.
Basically locate searches a locally stored database.
Default in Mac OS X the locate database isn't generated, and there is no need to unless you are a console user. To enable this you have to open a console and type
This means the indexing should appear 3:15 every Saturday. I suppose it's a normal and quite good time to index the database, but being able to update it manually is a very good option sometimes as well too. To do this simply run
$ sudo /usr/libexec/locate.updatedb
# To simplify this you can create an alias, type
$ sudo ln -s /usr/libexec/locate.updatedb /usr/bin/updatedb
# Now you can simply type
$ sudo updatedb
Using the database
This is very simple, just type
$ locate <searchterm>
$ locate apachectl
# Will return something like this