Re: Scripting question ...

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/plain)
Delete this message
Reply to this message
Author: der.hans
Date:  
To: Main PLUG discussion list
Subject: Re: Scripting question ...
Am 08. Mär, 2015 schwätzte so:

moin moin Joe,

I don't see an exclude option for locate, so you probably want to use the
-v option for grep. -v says to show anything that doesn't match the
pattern.

$ echo anke | grep -v fred
anke
$

$ echo 'anke
> fred' | grep -v fred

anke
$

BTW, the man page says -y is an old synonym for -i, so you might want to
use -i rather than -y unless you have a compatability issue somewhere.

ciao,

der.hans

> How can I exclude a specified directory (or perhaps more than one)
> from a 'locate' search for files containing a certain name or word
> on my system?
>
> For example, I frequently now use the following:
>
> $ locate filename | fgrep -ya "/home/joe" <E>
>
> How could I modify that to exclude all files with the specified
> filename in one (or more) specified subdirectories?
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>


-- 
#  http://www.LuftHans.com/        http://www.PhxLinux.org/
#  "It is a miracle that curiosity survives formal education."
#   -- Albert Einstein
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss