{"id":3116,"date":"2019-03-10T18:59:01","date_gmt":"2019-03-10T10:59:01","guid":{"rendered":"https:\/\/www.ookangzheng.com\/?p=3116"},"modified":"2020-05-24T15:58:28","modified_gmt":"2020-05-24T07:58:28","slug":"linux-tar-gz-bz2-xz-comparison","status":"publish","type":"post","link":"https:\/\/www.ookangzheng.com\/linux-tar-gz-bz2-xz-comparison\/","title":{"rendered":"Linux tar gz, bz2, xz comparison"},"content":{"rendered":"\n
In the UNIX\/Linux community, traditionally, if you want to compress files, you usually use tar plus gzip compression. Later, gzip is gradually replaced by bzip2, and now more and more people are using LZMA2. Xz to compress the tar file, even kernel.org also started from the end of 2013, while using the tar.gz and tar.xz compression format to release the Linux kernel source code, while the hyperlink on the home page is directly using tar. Xz This format, the previous tar.bz2 is directly discarded.<\/p>\n\n\n\n
tar.gz or tgz<\/strong><\/code><\/h3>\n\n\n\n\/\/ Compress
tar zcvf file_name.tar.gz dir_name
\/\/ Decompress
tar zxvf file_name.tar.gz<\/pre>\n\n\n\ntar.bz2<\/code><\/h3>\n\n\n\n\/\/ Compress
tar jcvf file_name.tar.bz2 dir_name
\/\/ Decompress
tar<\/gwmw> jxvf<\/gwmw> file_name.tar.bz2
tar<\/strong> -jxvf bar.tar.bz2 -C \/<\/strong>tmp\/<\/strong>bar<\/pre>\n\n\n\ntar.xz<\/code>