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 .

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 .

LEARN MORE  Linux X11 Connection Rejected Because of Wrong Authentication Error and Solution

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

One Reply to “Gzip Command Tutorial With Examples For Linux”

Leave a Reply

Your email address will not be published.