
1. To compress a file.
# gzip testfile.ext
2. To extract a compressed file.
# gunzip testfile.ext.gz
3. To compress a file with zip.
# zip -r testfile.zip
4. To extract the contents of a zip file.
# unzip testfile.zip
5. To create a tar file.
# tar -cvf testfile.tar
6. To list the contents of a tar file.
# tar -tvf testfile.tar
7. To extract the contents of a tar file.
# tar -xvf testfile.tar
8. To combine extract the contents of tar and gz file.
# tar -xvzf testfile.tar