Re: quickie UNIX command


Subject: Re: quickie UNIX command
From: cdowns (cdowns@skillsoft.com)
Date: Thu May 17 2001 - 11:17:34 MDT


the -v option remove the string specified and creates a new file without
those strings.
i think this is what you are tring to do.
example:

evil hacker wants his ipaddress out of a log file so :
cat /var/log/messages | grep -v "123.123.123.123" >>
/var/log/messages.new ; mv /var/log/messages.new /var/log/messages

thats it and hes is gone from that log.

-D
Gawain Reifsnyder wrote:

> At 1:06 PM -0400 on 5/17/01, cdowns wrote:
>
> >>I want to remove files in a directory on my YDL machine that contain
> >>a certain string. I think I'm getting close but no cigar... I'm
> >>thinking it's something like:
> >>
> >>rm | grep -l 'search string' *
> >>
> >>Any hints?
> >>
> >cat <filename> | grep -v "string_name" >> <newfile>
> >
> >and it will be stripped and a new file created .
> >
> >-D
> >--
>
> Thanks Chris! I don't want to strip the string, though. I want to
> delete the file containing the string. Or perhaps I'm not
> understanding your message...

--
------------------------------
    Christopher M Downs
Network Security Administrator
   Skillsoft Corporation
    cdowns@skillsoft.com
"Micro$oft typed backwards
      spells "c:\duh /?"
------------------------------



This archive was generated by hypermail 2a24 : Thu May 17 2001 - 10:23:33 MDT