I often use the find or the locate commands in Terminal to search for stuff scattered all over my file system. They both work well, however, both also have drawbacks. locate is nice and fast, as it searches a pre-built database, however this database isn't kept updated on a regular basis -- it's rebuilt once a week by the /etc/weekly script, if your computer is on at 3AM. As a result, locate will miss newly created or downloaded files.
find is great -- it walks your filesystem to find things, however, this process isn't exactly fast if you've got half-a-million files on your drive. find> also has some very useful features for doing things to the found files, but that's a topic for another hint on its own.
Not wanting to get rid of the funtionality of find, locate is an ideal candidate for replacement as it purely searches its database for filenames. Add the following snippet to your .bashrc file, and it will redefine the locate command to search the Spotlight database rather than /var/db/locate.database.
# using the new md* commands in Tiger, this is a find, based on filename,
# using the spotlight database. No having to build the locate database
# and keep it up to date, or run the usual find that walks the filesystem
# It's done as a function so I can use command-line arguments
# and single and double quotes.
function locate { mdfind "kMDItemDisplayName == '$@'wc"; }
There are many other kMDItem parameters you can also search on that have been referred to in other hints. For completeness' sake, they're located in this Spotlight Metadata Attributes article on Apple's Developer site.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050507212241122