小编Gui*_*ido的帖子

为什么 Gzip 压缩不能消除重复的数据块?

我只是做了一个小实验,我创建了一个包含重复文件的 tar 存档,看看它是否会被压缩,令我敬畏的是,它不是!详情如下(结果缩进阅读乐趣):

$ dd if=/dev/urandom bs=1M count=1 of=a
  1+0 records in
  1+0 records out
  1048576 bytes (1.0 MB) copied, 0.114354 s, 9.2 MB/s
$ cp a b
$ ln a c
$ ll
  total 3072
  -rw-r--r-- 2 guido guido 1048576 Sep 24 15:51 a
  -rw-r--r-- 1 guido guido 1048576 Sep 24 15:51 b
  -rw-r--r-- 2 guido guido 1048576 Sep 24 15:51 c
$ tar -c * -f test.tar
$ ls -l test.tar 
  -rw-r--r-- 1 guido guido 2109440 Sep 24 …
Run Code Online (Sandbox Code Playgroud)

linux compression gzip

31
推荐指数
2
解决办法
7652
查看次数

标签 统计

compression ×1

gzip ×1

linux ×1