Stopping smoking is tough.
Prohibition just makes the urge stronger
I like this article by Clive James.
...and I'm lighting one up in my memory right now :)
A lot of Linux/Unix files you find yourself working with will be compressed using tar and/or gzip. These are files with extensions like .tar and .tar.gz.
Extracting
For.tgz, tar.gz, or tar.z extension use this command:tar -zxvf {filename}
Eg: tar -zxvf filename.tar.gz
This will extract the file for you in the directory you are currently in. Using the above command will save you from having to redirect the output for gzip or anything else (because the z option automatically decompresses the file for you), otherwise without the z argument, you would have to do the extraction for the gzip first, then do a tar -xvf for the tar archive.
Archiving
To create a gzipped .tar file, use the following command...
tar -cf {filename}
...to create filename.tar
Eg: tar -cf filename
- Then -
gzip {filename.tar}
...to create filename.tar.gz