<div dir="auto"><div dir="auto">Hi Brian,</div><div dir="auto"><br></div><div>I personally use 'locate' all the time, and rarely use 'find' if 'locate' is available.<div dir="auto"><br></div><div dir="auto">The major problem I have with find is that it's slow. Even restricting the search space to a specific directory (as opposed to searching everything under "/") can be slow. For example, searching my home directory takes a while, due to the large number of Python virtual envs that I have.</div><div dir="auto"><br></div><div dir="auto">Sometimes searching a specific directory simply does not work with find due to the presence of symlinks. You have to wait for find to complete (which might take a while), realize that maybe symlinks are involved (which is not obvious) and re-run find with -L, hoping it will work.</div><div dir="auto"><br></div><div dir="auto">Searching from the root directory "/" with find is not just slow, but also clobbers the terminal with "Permission Denied" or "Operation Not Permitted" errors. You must remember to use 2>/dev/null (hoping that won't hide any useful errors).</div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">With locate instead you can search the entire filesystem and get your results in a few milliseconds, without thinking about edge cases.</span><br></div><div dir="auto"><br></div><div dir="auto">Also, if you want to always exclude certain filesystems or directories, with find you have to play with -prune or -xdev or similar, and repeat the same arguments every time. With locate, you can just edit one configuration file once and you're done. In my locate configuration I exclude things like my LXC/LXD containers: I never want results involving those.</div><div dir="auto"><br></div><div dir="auto">Those are the reasons why I wish locate was enabled everywhere, not just Ubuntu :-)</div><div dir="auto"><br></div><div dir="auto">Hope this helps!</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 22, 2019, 20:00 Brian Murray <<a href="mailto:brian@ubuntu.com" target="_blank" rel="noreferrer">brian@ubuntu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Ubuntu Foundations team was recently looking at an issue with<br>
mlocate[1] and the effect it has on all users of Ubuntu. While that<br>
specific issue is fixable there are also issues[2,3] with keeping<br>
PRUNEFS and PRUNEPATHS current in updatedb.conf. So we ended up<br>
questioning the usefulness of installing mlocate by default on systems<br>
at all. We believe that find is an adequate replacement for mlocate but<br>
want to hear from you about use cases where it may not be. I'll start<br>
with a personal example:<br>
<br>
"I don't remember (because I need to know so infrequently) where the<br>
meta-release file is cached on disk by update-manager and use locate to<br>
find it. The find command itself is inadequate because the cached file<br>
exists in both /home and /var."<br>
<br>
[1] <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880507" rel="noreferrer noreferrer noreferrer" target="_blank">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880507</a><br>
[2] <a href="http://launchpad.net/bugs/827841" rel="noreferrer noreferrer noreferrer" target="_blank">http://launchpad.net/bugs/827841</a><br>
[3] <a href="http://launchpad.net/bugs/1823518" rel="noreferrer noreferrer noreferrer" target="_blank">http://launchpad.net/bugs/1823518</a><br>
<br>
Thanks,<br>
--<br>
Brian Murray<br>
<br>
-- <br>
ubuntu-devel mailing list<br>
<a href="mailto:ubuntu-devel@lists.ubuntu.com" rel="noreferrer noreferrer" target="_blank">ubuntu-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel</a><br>
</blockquote></div></div></div>