[plug] appending files

Nick Bannon nick at ucc.gu.uwa.edu.au
Fri Sep 20 14:22:31 WST 2002


On Fri, Sep 20, 2002 at 02:03:40PM +0800, Jon L. Miller wrote:
> I need to append files that are already compressed (log files) into one
> (1) file.
> Would the best way be to unzip the file and do a cp file1+file2?

Your DOS is showing. ::-) You can join files with the conCATenate
command ("cat" takes one or more files, and sends them through to the
output).

Usually you would have to uncompress, but in the special case of gzip,
you don't. If gunzip sees two chunks of compressed text one after the
other, it will process both.

So - you can go ;
$ cat *.log.gz > biglog.gz

...rather than ;
$ gunzip *.log.gz
$ cat *.log | gzip > biglog.gz

Nick.

-- 
     Nick Bannon      | "I made this letter longer than usual because
  nick-sig at rcpt.to    | I lack the time to make it shorter." - Pascal
http://linux.conf.au/ |  Australian Linux Technical Conference, 2003



More information about the plug mailing list