{"id":1246,"date":"2014-04-16T10:45:47","date_gmt":"2014-04-16T14:45:47","guid":{"rendered":"http:\/\/linux.uits.uconn.edu\/jar02014\/?p=102"},"modified":"2014-04-16T10:45:47","modified_gmt":"2014-04-16T14:45:47","slug":"recursive-gzip-sometimes-helps","status":"publish","type":"post","link":"https:\/\/technicalknow-how.com\/wp\/recursive-gzip-sometimes-helps\/","title":{"rendered":"Recursive Gzip Sometimes Helps"},"content":{"rendered":"<p>Everyone knows that gzip&#8217;ing a file will usually make it smaller, but gzip&#8217;ing it again will not. In other words, once you&#8217;ve compressed a file, it won&#8217;t compress further. \u00a0 But here&#8217;s an exception.<\/p>\n<p>If you make a file of identical bytes, it can be gzip&#8217;ed several times and still become smaller. \u00a0In the example below, we made a 2GB file which consisted of identical bytes, all equal 0. \u00a0The first compression reduced the size by a factor of 1024. \u00a0The second by a factor of 602. \u00a0Next, by a factor of 14. \u00a0The next compression, not shown, grew the file by about 20 bytes. \u00a0The total compression, over the three generations, was a factor of <strong>9,023,041\u00a0<\/strong>!<\/p>\n<pre>&gt; dd if=\/dev\/zero of=2gb.zero bs=1024576 count=2048\n&gt; gzip -c 2gb.zero       &gt; 2gb.zero.gz\n&gt; gzip -c 2gb.zero.gz    &gt; 2gb.zero.gz.gz\n&gt; gzip -c 2gb.zero.gz.gz &gt; 2gb.zero.gz.gz.gz\n&gt; ls -lh 2gb.zero\n2.0G\u00a0 2gb.zero\n2.0M\u00a0 2gb.zero.gz\n3.4K\u00a0 2gb.zero.gz.gz\n328B\u00a0 2gb.zero.gz.gz.gz<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Everyone knows that gzip&rsquo;ing a file will usually make it smaller, but gzip&rsquo;ing it again will not. In other words, once you&rsquo;ve compressed a file, it won&rsquo;t compress further. &nbsp; But here&rsquo;s an exception. If you make a file of &hellip; <a href=\"http:\/\/linux.uits.uconn.edu\/jar02014\/2014\/04\/16\/recursive-gzip-sometimes-helps\/\">Continue reading <span>&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"wds_primary_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[123],"tags":[],"class_list":["post-1246","post","type-post","status-publish","format-standard","hentry","category-linux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3749z-k6","_links":{"self":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/posts\/1246"}],"collection":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/comments?post=1246"}],"version-history":[{"count":0,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/posts\/1246\/revisions"}],"wp:attachment":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/media?parent=1246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/categories?post=1246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/tags?post=1246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}