When you use the command gzip file_x , it will compress the data and rename it as file_x.gz.
1 2 3 4 5 6 7 |
brawldare-lm:gzip_learn$ ls file_x brawldare-lm:gzip_learn$ gzip file_x brawldare-lm:gzip_learn$ ls file_x.gz |
In order to keep the original file, we use the following command:
gzip -c input.txt output.txt.gz
1 2 3 4 5 6 7 8 |
brawldare-lm:gzip_learn>>ls file_x brawldare-lm:gzip_learn>>gzip -c file_x > file_x.gzip brawldare-lm:gzip_learn>>ls file_x file_x.gzip brawldare-lm:gzip_learn>> |
Similarity, we can keep the origin zip file when we do decompression using gunzip:
1 2 3 4 5 6 7 |
brawldare-lm:gzip_learn>>ls file_x file_x.gzip brawldare-lm:gzip_learn>>gunzip -c file_x.gzip > gg brawldare-lm:gzip_learn>>ls file_x file_x.gzip gg |