{"id":6934,"date":"2022-10-24T17:12:05","date_gmt":"2022-10-24T17:12:05","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=6934"},"modified":"2022-10-24T17:12:05","modified_gmt":"2022-10-24T17:12:05","slug":"zip-archive-and-compress-tools-in-linux","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2022\/10\/24\/zip-archive-and-compress-tools-in-linux\/","title":{"rendered":"Zip, Archive and Compress tools in Linux"},"content":{"rendered":"<p>Here are the different apps in linux for compressing and archiving files.<\/p>\n<p>Definitions:<\/p>\n<p>Tarball: A tarball is a collection of multiple files in Linux stored as a single file. The term tarball comes from the coal-based sealant used during construction works. A tarball is often simply called a TAR file, which stands for Tape Archive. This is because the TAR filetype was originally created to store data in magnetic tapes.<\/p>\n<p>Gzip: GNU gzip is a file compression algorithm used to compress files. The file extension for gzip is GZ and therefore, you can deduce that any file ending with GZ has been compressed using the gzip algorithm.<\/p>\n<p>TAR.GZ: A TAR.GZ file is a version of a tarball compressed with the gzip algorithm. TAR is the file extension for tarballs, whereas GZ denotes gzip. The TGZ file extension is also used sometimes instead of TAR.GZ.<\/p>\n<p>Bzip2: Similar to gzip, several other file compression algorithms are also available, including bzip2. When you compress a TAR file using bzip2, the output file will have either of the following extensions: TAR.BZ2, TAR.BZ, or simply TBZ.<\/p>\n<p>How to Create TAR and TAR.GZ Files<\/p>\n<p>Using the tar Utility<br \/>\nThe basic syntax to create compressed tarballs using the tar command is:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo tar -cvzf archive filename\n$ sudo tar -cvzf archive directory\n<\/pre>\n<p>Note that you need to pass the file extension (TAR or TAR.GZ) in the archive name as follows:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo tar -cvzf new.tar.gz big-file.txt\n$ sudo tar -cvf new.tar big-file.txt\n<\/pre>\n<p>To archive and compress the \/Documents directory using tar:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo tar -cvzf new.tar.gz ~\/Documents\n<\/pre>\n<p>You can also compress multiple directories and files by creating a single tarball. To do so:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo tar -cvzf new.tar.gz ~\/Documents ~\/Downloads file1.txt file2.txt\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here are the different apps in linux for compressing and archiving files. Definitions: Tarball: A tarball is a collection of multiple files in Linux stored as a single file. The term tarball comes from the coal-based sealant used during construction works. A tarball is often simply called a TAR file, which stands for Tape Archive. &#8230; <a title=\"Zip, Archive and Compress tools in Linux\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2022\/10\/24\/zip-archive-and-compress-tools-in-linux\/\" aria-label=\"Read more about Zip, Archive and Compress tools in Linux\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[139],"class_list":["post-6934","post","type-post","status-publish","format-standard","hentry","category-kb","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=6934"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6934\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=6934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=6934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=6934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}