gz文件压缩、解压缩保留源文件

1、

root@DESKTOP-1N42TVH:/home/test2# ls
outcome.map
root@DESKTOP-1N42TVH:/home/test2# gzip -c outcome.map > test.gz  ## 压缩并保留源文件
root@DESKTOP-1N42TVH:/home/test2# ls
outcome.map  test.gz

 

2、

root@DESKTOP-1N42TVH:/home/test2# ls
outcome.map  test.gz
root@DESKTOP-1N42TVH:/home/test2# gunzip -c test.gz > test.map  ## 解压并保留源文件
root@DESKTOP-1N42TVH:/home/test2# ls
outcome.map  test.gz  test.map
root@DESKTOP-1N42TVH:/home/test2# md5sum outcome.map test.map  
8109701d856a3e722da656e1271daf3b  outcome.map
8109701d856a3e722da656e1271daf3b  test.map

 

相关文章

Centos系统之Shell编程基础知识
从Export理解Shell环境和变量生存期
linux shell数组变量、类型及规则
Centos编程Shell基本工作原理方案
Centos操作系统编程之Shell 问答录
rsync-linux备份脚本