DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Updating Locate Database On Mac OSX

  • submit to reddit
        Open ~/.bash_profile and insert this line. 
Once it is in the bash profile you can run the following in the console: locate.update
That will then execute the command which will update the locate database.

alias locate.update="sudo /usr/libexec/locate.updatedb"

After locate database has been updated, go into console 
and to search for something type the following:locate <filename>
Where <filename> is the file you are looking for. It will locate the entire file system.
It's really useful if you are looking for a piece of software you installed and don't remember
it was suppose to be installed.