Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] matching to filter logfile



On 12/16/06, Al Hoang <hoanga@example.com> wrote:
> how can I match say "eth1" from /var/logs/messages so I can just get
> output of the lines that contain that item
>
How about:
cat /var/log/messages | grep eth1

Or

grep eth1 /var/log/messages

The end result is the same as Al's just removes the need for using cat
and a | ...

When playing with grep I also like to add --colour=auto so the above
would become:

grep --colour=auto eth1 /var/log/messages

This way you can see what grep is matching.

Regards, Keith


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links