It depends on what is in the file (the entropy, roughly). Given completely random contents compress
would actually1 make the file larger, and most implementations will refuse to do anything (the -v
option will often tell you this).
A file that contains entirely zero bytes will be compressed to a minimum of 8 bytes on the implementation I have to hand. I suppose that is the size limit, below which the magic number at the start of the compressed file and the basic "repeat this N times" instruction are longer than any input.
Given more usefully-distributed contents (like text) it varies pretty dramatically, but the threshold will be somewhere well into the tens of bytes at least. I wouldn't expect a 27-byte text file to compress, and an arbitrary 27-byte binary file even less so.
1 Of course, technically, it's random, so...
-f
option will force it to write out a compressed file even if the compressed version is larger than the original. A 0-length file compresses to 3 bytes with the version of compress on Ubuntu. – Mark Plotnick Jan 16 '15 at 22:29compress
command refuses to compress the file. – PriB Jan 17 '15 at 05:43