On 10/9/07, [EMAIL PROTECTED]@cus <[EMAIL PROTECTED]> wrote:
> need your help on these thing. im using tail to access the logs of one file.
> but the problem is it has too many info that i dont need. i used grep but im
> having a hard time filtering the output.can i use tail then grep for certain
> columns i want?
>
> e.g tail -f file.log | grep nColumn ???
Use either cut(1):
$ tail -f foo |cut -d ' ' -f N
or awk(1):
$ tail -f foo |awk '{print $N}'
I prefer the awk version since I don't have to care for (whitespace)
delimiters, but the cut version is nice if you're looking at
non-whitespace delimited text.
Cheers,
Zakame
--
Zak B. Elep || http://zakame.spunge.org
[EMAIL PROTECTED] || [EMAIL PROTECTED] || [EMAIL PROTECTED]
1486 7957 454D E529 E4F1 F75E 5787 B1FD FA53 851D
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph