Gzip Command Tutorial With Examples For Linux

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/gzip-command-tutorial-examples-linux/
PINTEREST
PINTEREST
INSTAGRAM

Gzip is actually a file format which is a compressed file. There is also a tool named gzip which is used to compress and decompress files. Gzip is developed in 1992. It use DEFLATE algorithm with LZ77 and Huffman coding.

Help

Help

Help

Compress File

Gzip can only compress file. It cannot compress multiple files  folder or folders. Gzip command is generally used with tar command. We will only provide the file to be compressed. In this example we will compress thefile.txt . The output file name will be the same with just adding .gz extension.

Compress File

Compress File

List Compressed File Contents

Compressed file contents can be listed without uncompressing them. We will use -l option. In the example we want to list thefile.txt.gz compressed file settings. There is also information about compressed size,  file ratio, uncompressed_name etc.

List Compressed File Contents

List Compressed File Contents

Higher Compression Rate

There are levels those are used to set compression ration, compressed file size and compression duration. Higher level compression will need more compression time but generally creates less file size. This is a trade off. We will use -9 or --best options to specify.

Higher Compression Rate

Higher Compression Rate

Faster Compression

Another option for compression is faster compression. Actually thie is reverse of the higher compression rate. Compression duration will be less but the size will be higher than default compression rate. We will use -1 or --fast .

LEARN MORE  How To Set Java Home Path?

Faster Compression

Faster Compression

Decompress File

Files can be decompressed with gunzip command or with -d parameter. gunzip is actually the alias of gzip -d .

Decompress File

Decompress File

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/gzip-command-tutorial-examples-linux/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

1 Response

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)