Compress
compress 文件名 -v 详细信息 -d 等于 uncompress 默认只识别 .Z -c 输出的标准输出 再结合> 生成文件
Bzip2
-k 保持原文件或原压缩包不变 -d 或 bunzip2 解压 -c 文件名 > 压缩包 压缩后保持原文件不变,但权限会根据umask变化 -cd 压缩包 > 文件名 或 bzcat 压缩包 > 文件名 解压后保持压缩包不变, 但权限会根据umask变化 -v 详细信息 -# 表示指定压缩比,默认是9,数字越小,表示压缩比越小,速度越快 反之,数字越大,压缩比越大,速度却越慢。
Xz
-K keeps the original file or the original compressed package unchanged-D or UNXZ unzip-C file > Compress package to keep the original file unchanged, but the permissions will vary according to Umask-CD Compression Package > Text File name or XZCAT package > FileName decompression keeps the package intact but the permissions vary according to Umask-V details-# represents the specified compression ratio, the default is 6, the smaller the number, the lower the compression ratio, the faster the speed Conversely, the larger the number, the greater the compression ratio, the slower the speed.
Zip Oracle
-r 压缩包名 源文件…… unzip 压缩包名 cat /var/log/messages | zip messages - unzip -p message > message
Tar * * *
-可以不要 -c 创建包 -v 详细过程 -f 指定生成后的文件名 源文件…… tar -tvf mage.tar 预览归档文件 tar -r /etc/fstab -f mage.tar 往归档中增加文件 tar --delete etc/fstab -f mage.tar 从归档中减少文件 tar -xv passwd -f mage.tar 从归档中解出指定的文件 tar -xvf mage.tar 从归档中解出所有文件 tar xvf mage.tar -C /app2 解压到指定目录,默认为当前目录 -j 使用bzip2 压缩或解压缩(可省略) -J 使用xz 压缩或解压缩(可省略) -z 使用gzip 压缩或解压缩(可省略) tar jcvf mage.tar.bz2 * tar xvf mage.tar.bz2
Split-b 3k-d mage.tar.xz mage-parts to split Mage.tar.xz
- Cat mage-parts0 > Mage.tar.xz merge the split files
Compression and archiving of Linux files