Saturday 5 March 2011

Use tar.gz on GNU/Linux

To decompress a tar.gz archive use this syntax from command line level:
gzip -dc file_name.tar.gz | tar xf -

If you want to add files to tar archive, use this syntax:
tar -cvf file_name.tar file_to_compress
if you need to use gzip to compress tar archive use additional 'z' parameter:
tar -cvfz file_name.tar.gz file_to_compress


an example:
tar -cvf archive.tar ./directory/*