How to keep original file when using gzip/gunzip

Tags: , ,

When you use the command gzip file_x , it will compress the data and rename it as file_x.gz.

In order to keep the original file, we use the following command:

gzip -c input.txt > output.txt.gz

Similarity, we can keep the origin zip file when we do decompression using gunzip: