如何在Linux中使用Gzip压缩和解压文件
Gzip is a popular data compression program in Linux. It is used to compress and decompress files.
To compress a file using gzip, use the following command:
gzip filename
To decompress a gzip compressed file, use the following command:
gzip -d filename
Replace filename with the actual name of the file.
Gzip will compress the file and create a new file with the extension .gz. The original file will be replaced with the compressed file.
To view the contents of a compressed file, use the following command:
gzcat filename
To compress a file and keep the original file, use the following command:
gzip -c filename > filename.gz
The original file will be kept and a new file with the extension .gz will be created.
To uncompress a file and keep the original file, use the following command:
gzip -d -c filename > filename.orig
The original file will be kept and a new file with the extension .orig will be created.
相关文章