Developers Heaven Forum

Operating Systems => Lunix & Unix => Topic started by: admin on November 20, 2010, 01:49:13 PM

Title: How to (compress) gzip a folder?
Post by: admin on November 20, 2010, 01:49:13 PM
How to gzip a folder?

Gzip can only compress a single file. tar can archive multiple files, but it doesn't compress them. Therefore the two tools are oftne used together: first you archive all the files into one with tar, then you compress that file with gzip (that's the z option in the tar command).

Code: [Select]
tar -cvzpf archive.tar.gz /home/example/public_html/folder

To uncompress again:

Code: [Select]
tar -xvzpf archive.tar.gz