what is the difference between commands compress, pack and gzip

Are the above commands does the same job ?

same functionaliy ?

If so, why do we have three utilities for the same functinality.

Yes in some ways they are the same functionality they intend to compress data.
Some do better than others e.g gzip is better than compress and pack in overall .

compress and gzip are alike in some ways as they are exploit the same algorithm but they differ in some ways.

compress : The compress utility will attempt to reduce the size of the named files by using adaptive Lempel-Ziv coding. Typically, text such as source code or English is reduced by 50-60%. Compression is generally much better than that achieved by Huffman coding (as used in pack ).

pack : The pack command attempts to store the specified files in a compressed form. Wherever possible (and useful), each input file file is replaced by a packed file file.z with the same access modes, access and modified dates, and owner as those of file. If pack is successful, file will be removed.

gzip Is a GNU version of Lempel-Ziv coding (LZ77) which reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension �.gz�, while keeping the same ownership modes, access and modification times.

1 Like