<p dir="ltr">I am not sure what you are doing but you may want to instead search the directories you want with find instead of using locate.</p>
<div class="gmail_quote">On Mar 8, 2015 10:36 AM, "der.hans" <<a href="mailto:PLUGd@lufthans.com">PLUGd@lufthans.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 08. Mär, 2015 schwätzte <a href="mailto:joe@actionline.com" target="_blank">joe@actionline.com</a> so:<br>
<br>
moin moin Joe,<br>
<br>
I don't see an exclude option for locate, so you probably want to use the<br>
-v option for grep. -v says to show anything that doesn't match the<br>
pattern.<br>
<br>
$ echo anke | grep -v fred<br>
anke<br>
$<br>
<br>
$ echo 'anke<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
fred' | grep -v fred<br>
</blockquote>
anke<br>
$<br>
<br>
BTW, the man page says -y is an old synonym for -i, so you might want to<br>
use -i rather than -y unless you have a compatability issue somewhere.<br>
<br>
ciao,<br>
<br>
der.hans<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How can I exclude a specified directory (or perhaps more than one)<br>
from a 'locate' search for files containing a certain name or word<br>
on my system?<br>
<br>
For example, I frequently now use the following:<br>
<br>
$ locate filename | fgrep -ya "/home/joe" <E><br>
<br>
How could I modify that to exclude all files with the specified<br>
filename in one (or more) specified subdirectories?<br>
<br>
<br>
<br>
------------------------------<u></u>---------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.<u></u>org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a><br>
<br>
</blockquote>
<br>
-- <br>
#  <a href="http://www.LuftHans.com/" target="_blank">http://www.LuftHans.com/</a>        <a href="http://www.PhxLinux.org/" target="_blank">http://www.PhxLinux.org/</a><br>
#  "It is a miracle that curiosity survives formal education."<br>
#   -- Albert Einstein<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div>