File Compression
From Camilo's web

These are the commands used to compress/extract zip or tar.gz files directly from the terminal.
Zip files
To compress
The "-r" indicates that the compression has to be done recursively. Without it, the command treats the folder "folder_to_compress" as a file and fails to do the compression.
zip -r compresed_file.zip folder_to_compress
To extract
unzip compressed_file.zip
tar.gz files
To compress or extract this kind of files we need to use the "tar" command. We can find all its options on its manual. Here are some of them:
- -c: Create
- -r: Add or replace
- -t: List
- -x: Extract
- -f <filename>: Location of the file
- -z: Use gzip to compress or extract.
- -v: Verbose (it spells out every file that you put in the compressed file).
To compress
tar -zcvf compressed_file.tar.gz folder_to_compress
To extract
tar -zxvf compressed_file.tar.gz