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

Re: Alternative to tar?



Gaël DONVAL <gael.donval@cnrs-imn.fr> wrote:
> Do you know of any lighter/simpler alternative to the tar program?
> tar preserves permissions, time stamps, etc. and this is great in some
> cases. But in other cases, one just wants a simple way to concatenate
> files.

    cat
    cpio
    7z
    zip

Tar is pretty lightweight (at least, it was until GNU got hold of it).

	tar cf target.tar source...
	tar xf target.tar

"target.tar" can be "-" to reference stdin/stdout (i.e. a pipe). If
you restore files with it as root, it attempts to handle ownerships and
permissions on extraction. If you don't it does what it can. Add "z" or
"j" as te first letter argument to enable compression (gzip and bzip2,
respectively).

Cat does exactly what you've asked for, "a simple way to concatenate
files", but I suspect that's not what you really mean. Cpio is marginally
more flexible but wildly complicated. 7z and zip have ancestors in the
DOS world but can be considered as equivalent to tar with compression
enabled. Different process, though: 7z and zip compresses each file
separately (I believe) and adds the result to the archive. Tar/gzip adds
each file to the archive and compresses the result.

Chris


Reply to: