[CentOS] Log File Reviewing

Joshua Gimer jgimer at gmail.com
Mon Jan 5 19:19:54 UTC 2009


What about:

perl -ne 'if (/^\s*word/) { print $_; }' logfile

any others?

On Mon, Jan 5, 2009 at 11:45 AM, Joseph L. Casale
<JCasale at activenetwerx.com> wrote:
> I need to review a logfile with Sed and cut out all the lines that start with a certain word, problem
> is this word begins after some amount of whitespace and unless I search for whitespace at the
> beginning followed by "word" I may encounter "word" somewhere legitimately hence why
> I don't just search for "word" only...
>
> Anyone know how to make sed accomplish this?
>
> Thanks!
> jlc
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Thx
Joshua Gimer


More information about the CentOS mailing list