Having Fun With The “Locate” Command
Jake Bechtold | November 27, 2006One of the great features of Mac OS X is it’s Unix Terminal. One very useful command in the terminal is the “Locate” command. This will allow you to find any file on your hard drive within seconds, faster than Sherlock can find it. It is actually more like Spotlight. You can just type in any word, and it’ll find all files with that word in it. Even more, since Mac OS X is built on Linux, you can use the locate command in Linux as well.
Locate with Terminal
As I mentioned, the “Locate” command, in sense, is like Spotlight. For example, if you pull up terminal and type in “locate jake”, it lists all of the files that contain the word “jake”. Obviously, since “Jake” is my name, pretty much every file on my system will show up. If you wish to take this further you can type in “locate jake*”. This will locate all the files that start with the word “Jake”. In my case (as shown to the right), none of the files start with “Jake”.
Keep in mind you’ll want to keep this database up to date. This can be done by going to terminal and typing in “su updatedb”. This will update the database, allowing the locate command to find files within seconds.
Locator”
If you’re not the type who likes to mess with the terminal, then maybe “Locator” is for you (Screenshot at the top of the post). This Mac OS X freeware program by Sebastian Krauss is a graphical interface to the locate command. Just like you would in terminal, just enter in the word or part of the file name you are looking for, and Locator will find the files, just like in terminal, just in a graphical interface. You can even update the database from Locator as well.
The Locate Command is a useful tool that I think all Linux/Unix users should use. If you’re on Mac, Locator along with the Locate Shell Command is the thing the find any file you need, fast.
Locator 0.7.3 [Sebastian Krauss]
