ITPub博客

首页 > 应用开发 > IT综合 > compress 命令

compress 命令

原创 IT综合 作者:bhk2004 时间:2007-03-08 13:59:13 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/7180624/viewspace-903446/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    76
  • 访问量
    1141005