首先生成一个大小800M的test.txt文件
dd if=/dev/zero of=test.txt bs=100M count=8
[root@localhost ~]# dd if=/dev/zero of=test.txt bs=100M count=8
记录了8+0 的读入
记录了8+0 的写出
838860800字节(839 MB)已复制,3.9642 秒,212 MB/秒
[root@localhost ~]#
我们现在使用zip命令进行压缩
zip test.zip test.txt
我们可以用的unzip对压缩后的文件进行解压
zip test.zip test.txt
-d可以指定解压路径
tar压缩与解压缩
[root@localhost tmp]# tar -czvf test.tar.gz test.txt
test.txt
[root@localhost tmp]# ls
test.tar.gz test.txt
[root@localhost tmp]#
-c 创建压缩包
-z 使用gzip压缩
-v 查看压缩的内容
-f 跟文件名
解压缩:
zip test.zip test.txt
-x 解压缩文件
gzip的压缩
zip test.zip test.txt