Faster Concatenation of files

Dear All

I am using cat command for concatenating multiple files. Some time i also use append command when there are few files.
Is there faster way of concatenating multiple files(60 to 70 files) each of
156 MB or less/more.:slight_smile:

Thanx

If the input files are all on the same physical disk/logical you are probably IO bound no matter what you do. Most of the time spent in any event is disk I/O wait time - especially if you are reading and writing to the same logical volume/physical disk.

If you can find a disk/logical volume that is not busy, then put your destination file there.

Otherwise, cat is pretty efficient - on HPUX 11i -

> time cat Cletr062606.txt > /dev/null

real    0m6.95s
user    0m0.01s
sys     0m0.28s

Most six seconds here is probably related to i/o wait time. The system was not busy at this time. /dev/null does not write to disk, so this is related to read wait times. This is for a 120MB file. My version of cat calls read with an 8192 byte buffer.