If you have been using linux for a few days, you see that it's almost impossible to go by without seeing a compress file. Here are the basic rules on how to create compressed folders .zip, .gz .tar / .tar.gz / .tar.bz2 .7z files
gunzip somefile.gztarball will you search for datasets. These are basically a combination of the tar compression then compress using gzip. Here are two ways to decompress them.
gunzip < file.tar.gz | tar xvf -$ gunzip < file.tgz | tar xvf -or simpler
tar xvzf file.tar.gzIt is good to notice that tar can be combine with other things compression method like bzip2, xz, lzip, lzma and compress. With a tar.bz2, you will need to replace the z flag used earlier with the j flag.
tar xvjf file.tar.bz2
sudo apt-get install unrar (Debian like distros) sudo yum install unrar (CentOs like distros) sudo pacman -S p7zip (Archlinux like distros)To compress files and folder, use the a flag
7z a compressFolder.7z *.jpg
7z a compressFolder.7z Documents/
tar cf - directory | 7z a -si directory.tar.7z
7z x -so directory.tar.7z | tar xf