tar and gzip

TAR

Creating a tar archive:

tar -cf archive.tar myDirectories/

Listing the contents of an archive:

tar -tf archive.tar

Extracting all files from an archive:

tar -xf archive.tar

To extract just partial pieces from the archive, supply a file or directory name after the archive name. You can list as many as desiered here, separated by spaces.

tar -xf archive.tar filename

GZIP

Compress:
gzip archive.tar

Decompress:
gunzip archive.tar.gz

Merging commands
The "z" flag works with gzip, to either create a tar/gzipped archive:
tar -czvf archive.tgz files/

...or decompress a tar/gzipped archive:

tar -xzvf archive.tgz

TAR to pipe
tar to a pipe, just stores in temporarily memory.

tar -cf - ./filename | (cd other-directory; tar -xf -)

Please Register.


If you wish to add comments.
Cheers
Adam