Author Topic: How to (compress) gzip a folder?  (Read 3715 times)

Offline admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 296
    • View Profile
How to (compress) gzip a folder?
« 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