File compress and uncompress in linux

File compress and uncompress in linux

gzip command compresses files. Each single file is compressed into a single file. The compressed file consists of a GNU zip header and deflated data.
If given a file as an argument, gzip compresses the file, adds a “.gz” suffix, and deletes the original file.

 

gzip fileCompress file to create file.gz. Original file is deleted.

 

gunzip file.gzUncompress file.gz to create file. Original file.gz is deleted.