0

I try to gzip a file abc.log which has size of 111 bytes, but after gzip, the size of the file increased to 125 bytes, why is that? Is it when i perform gzip, it will create header and trailer that has certain size?

Command used:

gzip -5 abc.log
  • 1
    gzip adds header and trailer..it is possible that your abc.log is not (much) compressible and header and trailer are added with it moreover.. – heemayl Apr 5 '16 at 4:48
  • Releted link : unix.stackexchange.com/questions/46786/… – msc Apr 5 '16 at 5:11
  • you really shouldn't compress a file that small. – David Dai Apr 5 '16 at 5:31
2

Not just gzip, but attempting to compress a file which is already as small as possible can increase the size (because each method for compression has some overhead in the form of header, tables, etc). This is also referred to as negative compression.

Further reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.