Have a bundle identifier like com.apple.Safari and want to know which applications are associated with it and where on your system you have installed instances of the application?

Launch Terminal and type:

mdfind “kMDItemCFBundleIdentifier == ‘com.apple.safari’c”↩

to perform a case insensitive search.

If you want to achieve the same inside an application, you can use my TIMAppLocator class which can easily be dropped in any Cocoa project.