压缩和解压缩
/tmp 目录中建立一个大小为100M的文件 bigfile
dd if=/dev/zero of=/tmp/bigfile bs=1M count=100
if==inputfile 输入文件
of==outputfile 输出文件
bs 单位 count 计数器
压缩文件:gzip 文件名
解压缩文件:gunzip 压缩包
压缩文件:bzip2 文件名
解压缩文件:bunzip2 压缩包
打包压缩目录:(同时进行 tar -zcf)
1、tar-cf /tmp/aa.tar /tmp/bigfile
-cf(creatfile) 新文件名(路径) 需打包文件名(路径)
2、使用 gizp/bzip2 压缩新文件
解压缩目录 :(同时进行 tar -zxf)
1、使用 gunzip/bunzip2 解压缩
2、tar -xf aa.tar -C /root
-x 解包 -C 指定解压路径
-z gizp -j bizp2