TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:9972] Help with Grep





> -----Original Message-----
> From: Jonathan Kline [mailto:jonathankl@sabis.org]
> Sent: Wednesday, November 10, 1999 8:18 AM
> To: tclug-list@mn-linux.org
> Subject: [TCLUG:9972] Help with Grep
>
>
> Hello Again:
> 	Basically what I'm trying to do is search through a given file,
> namely /var/log/secure and look for FAILED LOGIN, ROOT LOGIN and refused
> connect.  When the above patterns are found, I want the line containing
> the pattern to be copied to a specified text file.... Does anyone know how
> to do this? IF so is it even possible?
> 	Thanks For the help!
>

grep -e"FAILED LOGIN" -e"ROOT LOGIN" -e"refused connect" /var/log/secure >>
/some/output/file

Better yet, "man grep".  All kindsa useful switches in there.