Compression

ZIP

To zip a file on Linux you can use the zip command, and point the compressed file to a directory to be saved.

zip test.zip myDirectory/

Unzipping is just as simple

unzip test.zip

TAR

The TAR command creates a TAR ball using compression utilities like GZIP.

tar -cvf test.tar.gz temp/
# -c Create
# -v Verbose
# -f Archive

To un-TAR a Tar Ball you can use the following

tar -xvf tes.tar

Which GZIP:

tar -cvzf test.tar.gz temp/
# -c Create
# -v Verbose
# -z Compression Technique ( GZIP ) or -j for BZ2
# -f Archive

Unzip a GZIP Tar Ball

gunzip test.tar.gz
#or
tar -xvzf test.tar.gz

Last updated