Unix tar compress8/29/2023 ![]() In this trivial example, we see that to get the smallest gz we need advdef (though 7z -tgzip is almost as good and a lot less buggy). To give a quick idea how these compression utilities compare, consider the effect of compressing patch-3.1.1 from the linux kernel: utility cpu format size(bytes) So even if you use xz compression you can still decompress as usual: tar xvf Modern versions of tar, for example on Ubuntu 13.10, automatically detect compressed files. If this doesn't matter to you, and you really want the smallest tar file, try: tar cv path/to/data | xz -9 > It also tends to be a bit slower, particularly when compressing. The main disadvantage of xz is that it isn't as common as gzip so the people you send the file to might have to install a new package. ![]() Generally, switching to a different format can give a vastly better improvement in compression than fiddling round with gzip options. Since you only recently learnt that tar can compress, and didn't say why you wanted the the smallest ".tar.gz" file, you may be unaware that there are more efficient formats can be used with tar files, such as xz. This is about the best you can do with the gz format. This will create a standard gz file that can be read by gzip and tar as normal, just a tiny bit smaller. ![]() To use advdef directly, create however you feel like. The advdef utility from AdvanceCOMP usually gives the smallest file, but is also buggy (the gz99 utility checks that it hasn't corrupted the file before accepting the output of advdef). To use this to create the smallest possible file run: tar c path/to/data | gz99 file.gz ![]() I have written a bash script " gz99" to try gzip, 7z and advdef to get the smallest file. There are many compression utilities that can compress to the gz format. Usually neither gzip nor tar can create "the absolute smallest tar.gz". ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |