next up previous contents
Next: top - To see Up: Other Useful Commands Previous: ssh - Secure shell   Contents

tar - Store/extract directory tree in/from a single file

Examples:-

tar cf mytar.tar mydirectory/

Create the tar file ``mytar.tar'' holding the entire directory subtree supported by the directory ``mydirectory/''.

tar xvf mytar.tar

Extract (unpack) the tar file ``mytar.tar'' into the current directory with verbose printout.

tar cf - mydirectory/ | gzip -c > mytar.tar.gz
gunzip -c mytar.tar.gz | tar xf -

Examples piping tar and gzip together to either create a compressed tar file or unpack a compressed tar file. The Linux version of tar can do this using the -z option e.g.:-

tar zcf mytar.tar.gz
tar zxf mytar.tar.gz



P.D. Gronbech (IT Staff) 2015-10-02