Portal Home > Knowledgebase > Server Administration > Tar Zip / File Compression


Tar Zip / File Compression




Tar Zip / File Compression

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

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Check Available Ports (Views: 1788)
O/S Info (Views: 1230)
Where to Find Logs? (Views: 1214)
SSH Command List (Views: 2980)
/tmp Partition Full (Views: 1248)