I often end up getting zipped files which I supposed to crack open and look into. Here are some tips working with compression in Linux.
 Use -l option to see the files it contains.
$ unzip -l _RawData.zip
 -d to unzip into a new directory.
$ unzip _RawData.zip -d _RawData
To zip a directory recursively, use the -r option.
 zip -r _NewData.zip _RawData
Note: looking at the sized, I found zip does quite a good job.
$ ls -lh _NewData.zip
-rwxrwx—+ 1 agoswami Domain Users 109M Dec 16 13:10 _NewData.zip
$ ls -lh _RawData
 zipping up all folders containing word “azure” and their contents
zip -r azpfg.zip *azure*
To zip urllib along with all azure folders, I do :
agoswami@agoswami-msft2 /cygdrive/c/Users/agoswami/AppData/Local/Continuum/Anaconda/Lib/site-packages $ zip -r azurllib3pkg.zip *azure* urllib3
Note : Because of various reasons some of which hearken back to the era of tape drives, Unix uses a program named tar to archive data, which can then be compressed with a compression program like gzip, bzip2, 7zip, etc
In order to “zip” a directory, the correct command would be
$ tar -zcvf _rawdata.tar.gz _RawData
$ ls -lh
-rwxrwxr–+ 1 agoswami Domain Users 109M Dec 16 15:43 _rawdata.tar.gz
This will tell tar to c (create) an archive from the files in directory (tar is recursive by default), compress it using the z (gzip) algorithm, store the output as a f (file) named archive.tar.gz, and v(verbosely) list all the files it adds to the archive.
To decompress and unpack the archive into the current directory you would use
tar -zxvf archive.tar.gz
gzip is a utility to compress / decompress individual files
$ ls -lh latency.txt
-rwxrwx—+ 1 agoswami Domain Users 3.0K Nov 22 20:07 latency.txt
$ ls -lh latency.txt.gz
-rwxrwx—+ 1 agoswami Domain Users 914 Nov 22 20:07 latency.txt.gz
to decompress : -d
$ gzip -d latency.txt.gz
to keep original file : -k
$ gzip -d -k rcv1.test.raw.txt.gz