我使用过的Linux命令之uncompress - 解压.Z文件
我使用过的Linux命令之uncompress - 解压.Z文件
本文链接:http://codingstandards.iteye.com/blog/790830?? (转载请注明出处)
用途说明compress命令是用来将文件压缩成.Z格式的,对应的uncompress是用来解压的。Compress? reduces? the size of the named files using adaptive Lempel-Ziv coding.? Whenever possible, each file is replaced by one with the extension .Z, while keeping the same ownership modes, access and modification? times.
这个命令使用的算法因为不够先进,在Linux下现在都采用gzip和gunzip来压缩和解压了。但是很多老的压缩文件可能是.z格式的,因此需要用到它。一般情况下,安装好的Linux系统下可能没有这个命令,那么就需要到安装盘中找到包含ncompress字符串的rpm包来进行安装。这也是网上很多人问“在LINUX 中没有COMPRESS这个命令”或“为什么linux中的compress不能用”的原因了。
常用参数因为compress和uncompress并不常用,因此参数并不太重要了,在需要时man一下就清楚了。
使用示例示例一 压缩文件[root@localhost ~]# ls -l install.log
-rw-r--r--? 1 root root 48038 10月? 8 17:18 install.log
[root@localhost ~]# compress install.log
[root@localhost ~]# ls -l install.log install.log.Z
ls: install.log: 没有那个文件或目录
-rw-r--r--? 1 root root 17034 10月? 8 17:18 install.log.Z
[root@localhost ~]#
[root@localhost?ss7linux]#?uncompress?dpklnx6.Z?
[root@localhost media]# mount /dev/cdrom
mount: block device /dev/hdc is write-protected, mounting read-only
[root@localhost media]# cd cdrom/
[root@localhost cdrom]# find . -name "ncompress*.rpm"
./CentOS/RPMS/ncompress-4.2.4-44.rhel4.i386.rpm
[root@localhost cdrom]# rpm -ivh ./CentOS/RPMS/ncompress-4.2.4-44.rhel4.i386.rpm
警告:./CentOS/RPMS/ncompress-4.2.4-44.rhel4.i386.rpm: V3 DSA 章:NOKEY, key ID 443e1821
中...?????????????????? ########################################### [100%]
?? 1:ncompress????????????? ########################################### [100%]
[root@localhost cdrom]# cd ..
[root@localhost media]# umount /dev/cdrom
1. compress和uncompress使用的压缩算法的大体原理如何?
2. 是比较各种压缩工具(compress、gzip、bzip2、tar、rar等)的效率、压缩比率?
相关资料【1】中国IT实验室 Linux 指令篇:编码压缩打包--compress
【2】哥的 Linux 私房菜? 第九章、案案系的打包
?
返回 我使用过的Linux命令系列总目录
?