Zip and unzip files on Linux

To compress files in Linux in zip format (the most used) is done in the following way to include folders and subfolders:

zip -r directory_name

Unzipping different formats

Extract ZIP files

To decompress in ZIP format we must do the following:


Extract TAR files

To unzip compressed files with tar (.tar extension) you have to type the following command:

tar xvf myfile.tar

Extract TAR.GZ files

To unzip a file with gunzip (extension .tar.gz), type the following:

tar -zxvf myfile.tar.gz

Extract GZ files

We can also use the gzip tool:

gzip -d myfile.gz

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.