filmov
tv
Unix & Linux: Which file compression software for linux offers the highest size reduction?

Показать описание
Unix & Linux: Which file compression software for linux offers the highest size reduction?
The Question: I do a ton of file compression. Most of the stuff I am compressing is just
code, so I need to use loss less compression. I was wondering if there was
anything that offers a better size reduction then 7zip. It doesn't matter how
long it takes to compress, or decompress, size is all that matters. Does anyone
know of a software like this in Linux? Or is 7zip the best?
Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful
== This solution helped 42 people ==
7zip is more a compactor (like PKZIP) than a compressor. It's available for
Linux, but it can only create compressed archives in regular files, it's not
able to compress a stream for instance. It's not able to store most of Unix
file attributes like ownership, ACLs, extended attributes, hard links...
On Linux, as a compressor, you've got xz that uses the same compression
algorithm as 7zip (LZMA2). You can use it to compress tar archives.
Like for gzip and bzip2, there's a parallel variant pixz that can leverage
several processors to speed up the compression (xz can also do it natively
since version 5.2.0 with the -T option). The pixz variant also supports
indexing a compressed tar archive which means it's able to extract a single
file without having to uncompress the file from the start.
== This solution helped 6 people ==
If you're looking for greatest size reduction regardless of compression speed,
LZMA is likely your best option.
When comparing the various compressions, generally the tradeoff is time vs.
size. gzip tends to compress and decompress relatively quickly while yielding a
good compression ratio. bzip2 is somewhat slower than gzip both in compression
and decompression time, but yields even greater compression ratios. LZMA has
the longest compression time but yields the best ratios while also having a
decompression rate outperforming that of bzip2.
== This solution helped 70 people ==
if you're compressing source code!
Quoting the README:
This is a compression program optimised for large files. The larger
the file and the more memory you have, the better the compression
advantage this will provide, especially once the files are larger
than 100MB. The advantage can be chosen to be either size (much
smaller than bzip2) or speed (much faster than bzip2). [...]The
unique feature of lrzip is that it tries to make the most of the
available ram in your system at all times for maximum benefit.
lrzip works by first scanning for and removing any long-distance data
redundancy with an rzip-based algorithm, then compressing the non-redundant
data.
10.3GB tarball of forty Linux Kernel releases down to 163.9MB (1.6%), and does
so faster than xz. He wasn't even using the most aggressive second-pass
algorithm!
I'm sure you'll have great results compressing massive tarballs of source code
:)
sudo apt-get install lrzip
Example (using default for others options):
Ultra compression, dog slow:
lrzip -z file
For folders, just change lrzip for lrztar
The Question: I do a ton of file compression. Most of the stuff I am compressing is just
code, so I need to use loss less compression. I was wondering if there was
anything that offers a better size reduction then 7zip. It doesn't matter how
long it takes to compress, or decompress, size is all that matters. Does anyone
know of a software like this in Linux? Or is 7zip the best?
Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful
== This solution helped 42 people ==
7zip is more a compactor (like PKZIP) than a compressor. It's available for
Linux, but it can only create compressed archives in regular files, it's not
able to compress a stream for instance. It's not able to store most of Unix
file attributes like ownership, ACLs, extended attributes, hard links...
On Linux, as a compressor, you've got xz that uses the same compression
algorithm as 7zip (LZMA2). You can use it to compress tar archives.
Like for gzip and bzip2, there's a parallel variant pixz that can leverage
several processors to speed up the compression (xz can also do it natively
since version 5.2.0 with the -T option). The pixz variant also supports
indexing a compressed tar archive which means it's able to extract a single
file without having to uncompress the file from the start.
== This solution helped 6 people ==
If you're looking for greatest size reduction regardless of compression speed,
LZMA is likely your best option.
When comparing the various compressions, generally the tradeoff is time vs.
size. gzip tends to compress and decompress relatively quickly while yielding a
good compression ratio. bzip2 is somewhat slower than gzip both in compression
and decompression time, but yields even greater compression ratios. LZMA has
the longest compression time but yields the best ratios while also having a
decompression rate outperforming that of bzip2.
== This solution helped 70 people ==
if you're compressing source code!
Quoting the README:
This is a compression program optimised for large files. The larger
the file and the more memory you have, the better the compression
advantage this will provide, especially once the files are larger
than 100MB. The advantage can be chosen to be either size (much
smaller than bzip2) or speed (much faster than bzip2). [...]The
unique feature of lrzip is that it tries to make the most of the
available ram in your system at all times for maximum benefit.
lrzip works by first scanning for and removing any long-distance data
redundancy with an rzip-based algorithm, then compressing the non-redundant
data.
10.3GB tarball of forty Linux Kernel releases down to 163.9MB (1.6%), and does
so faster than xz. He wasn't even using the most aggressive second-pass
algorithm!
I'm sure you'll have great results compressing massive tarballs of source code
:)
sudo apt-get install lrzip
Example (using default for others options):
Ultra compression, dog slow:
lrzip -z file
For folders, just change lrzip for lrztar