I find (pun not intended) the locate command very painful, it rarely produces anything useful when I use it and its command line options don't seem to help very much.
First problem is that by default it returns every single file that has the search expression in its path, so if I search for 'home' for example I get thousands and thousands of lines returned because it lists every sub-directory and file under /home. Surely it would be more useful if it just returned /home plus any files (or other directories) actually called 'home'. As it is the default is nearly always not what one wants.
Secondly I want a search for 'home' to return files and directories called 'home', not ones called 'homeAndAway' or anything else with 'home' in them. If I'm searching for something which has 'home' in it then I'll search for '*home*'.
I know there are ways of getting over the above two problems but IMHO the syntax to do so is a bit clumsy and inconvenient. The man page gives the syntax (in the only example it gives, maybe suggesting others have the same complaints as I do) :-
locate -b '\home'
Finally I want some way to exclude large chunks of my system from the search (or to *include* specific areas), my short-term backups are on my desktop system under /bak. As a result locate finds dozens of hits for any file which happens to be in the incremental backups.
If only locate worked the same way as find does, find does almost exactly what I want most of the time (but is very slow of course because it's not got a cron built database).
I guess I'm going to write a custom script round locate that makes it produce results much like find, but quickly. I'm just wondering if someone happens to have done it for me already.