gzip, zcat 压缩文件

来源:互联网 发布:手机淘宝怎么添加视频 编辑:程序博客网 时间:2024/05/17 22:54

gzip, zcat  压缩文件

[root@linux ~]# gzip [-cdt-] file    #压缩指定文件   

[root@linux ~]# zcat file.gz         #查看压缩文件内容

-c  :将压缩数据输出到指定文件,不改变原文件,用重导向功能

-d  :解压缩

-r  :递归压缩,包括目录下的所有文件

-t  :检验压缩文件一致性

--  :压缩等级,-1 最快,但是压缩比最低、-9 最慢,但是压缩比最高!默认是-6

[root@linux ~]# cd /tmp

[root@linux tmp]# cp /etc/man.config .

[root@linux tmp]# gzip man.config

[root@linux tmp]# zcat man.config.gz

[root@linux tmp]# gzip -d man.config.gz

[root@linux tmp]# gzip -9 -c man.config > man.config.gz

原创粉丝点击