compress 命令

compress 命令

[root@linux ~]# compress [-dcr] 文件或目录
参数:
-d :用来解压缩的参数
-r :可以连同目录下的文件也同时给予压缩呢!
-c :将压缩资料输出成为 standard output (输出到萤幕)
范例:
范例一:将 /etc/man.config 複制到 /tmp ,并加以压缩

[root@linux ~]# cd /tmp
[root@linux tmp]# cp /etc/man.config .
[root@linux tmp]# compress man.config
[root@linux tmp]# ls -l



-rw-r--r-- 1 root root 2605 Jul 27 11:43 man.config.Z

范例二:将刚刚的压缩档解开

[root@linux tmp]# compress -d man.config.Z

范例三:将 man.config 压缩成另外一个文件来备份

[root@linux tmp]# compress -c man.config > man.config.back.Z
[root@linux tmp]# ll man.config*



-rw-r--r-- 1 root root 4506 Jul 27 11:43 man.config
-rw-r--r-- 1 root root 2605 Jul 27 11:46 man.config.back.Z

# 这个 -c 的参数比较有趣!他会将压缩过程的资料输出到萤幕上,而不是写入成为
# file.Z 文件。所以,我们可以透过资料流重导向的方法将资料输出成为另一个档名。
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7180624/viewspace-903446/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7180624/viewspace-903446/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值