Using Tar:
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. tar -zcvf archive.tar.gz directory/
same as above, but do not include the parent folder itself in the tar archive. cd dir/ && tar -zcvf ../dir.tgz . && cd .. To decompress and unpack the archive into the current directory you would use the following. tar -zxvf archive.tar.gz