[Sunhelp] Re: combine several text log

Chris Slater olyar at yahoo.com
Wed Jun 28 15:51:02 CDT 2000


You might try this:

cat file1.log file2.log  | sort -u  | less

Not sure if there is a limit on what size of file cat can handle... 
You also might want to add a -r flag to the cat so that it skips
multiple blank lines.

You also might want to play around with some sort options so that it
sorts based on the field that you are interested in (not sure if the
time/date is the first field, what format it's in etc).

I would guess you'd want something like:

sort -k 2.1 (to sort based on the first character of the 2nd field).

Hope this helps,

Chris


--- Moshe Levy <moshel at odigo.com> wrote:
> Hi,
> 
> I have several big log files (something like 20M each) that i want to
> combine together in some way (i want to sort it by time and date
> first)
> and display on the screen as if they ware one file, and have the
> abillity to go over them like im using 'less'. (do a search or go up
> and
> down the log)
> any idea how can i do it ?
> I dont want to combine all the logs to a singel file (too much
> space).
> 
> Thanks.
> 
> 
>
-====---====---====---====---====---====---====---====---====---====---====-
>  to unsubscribe email "unsubscribe linux-admin" to
> majordomo at vger.rutgers.edu
>  See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/





More information about the SunHELP mailing list