{"id":239,"date":"2014-10-04T12:53:28","date_gmt":"2014-10-04T12:53:28","guid":{"rendered":"http:\/\/192.168.2.32:8082\/?p=239"},"modified":"2014-10-04T12:53:28","modified_gmt":"2014-10-04T12:53:28","slug":"tarball","status":"publish","type":"post","link":"https:\/\/www.dev-metal.ch\/?p=239","title":{"rendered":"Tarball"},"content":{"rendered":"<p><!--more-->A tarball is a (usually) compressed file that contains one<br \/>\nor more other files and was created using the UNIX\/GNU<br \/>\ntar program and (optionally) a compression program like gzip.<\/p>\n<p>Tar with compression is similar to the use of PKZIP (WinZip,<br \/>\nor ZIP or similar).\u00a0 TAR is Tape ARchive and is designed to<br \/>\ngroup one or more files in an archive to a file or media.\u00a0 Files are<br \/>\narchived with owner, permissions, path, etc.\u00a0 For more info,<br \/>\nRTFM man page on tar.\u00a0 Also note, CPIO (used internally by RPM)<br \/>\nis another archive format widely used (not addressed herein).<\/p>\n<p>Unlike RPM, tar files do not contain any pre-install or post-install<br \/>\nscripts, dependency information, nor any other information like<br \/>\ndescription, etc. (for example, use rpm &#8211;querytags to see a list<br \/>\nof what RPM can provide).<\/p>\n<h2>Linux\/UNIX use several compression formats:<\/h2>\n<pre class=\"lang:sh decode:true\">GZIP      -- GNU ZIP (a fast compression similar to PKZIP)\r\nZIP       -- PKZIP compatible compression (long file names)\r\nBZ\/BZ2    -- BZIP and BZIP2 -- new, slower but generate smaller files\r\nZ         -- UNIZ compress (not as good nor as fast as GZIP)\r\nLZ        -- LZ compression (not widely used)\r\n<\/pre>\n<h2>Standard suffixes (usually mapped to mime types):<\/h2>\n<pre class=\"lang:sh decode:true\">.gz   -- file is compressed with GZIP (gzip or gzip.exe)\r\n.tgz  -- tar file compressed with GZIP\r\n.Z    -- file if compressed with older UNIX compress\r\n.bz   -- file is compressed with bzip (new, replaced by bz2)\r\n.bz2  -- file is compressed with bzip2 (new, better than gzip\/pkzip)\r\n.zip  -- file is compressed with zip (pkzip or compat., zip)\r\n               typically ZIP is not used with tar, but an archive\r\n               may contain a tar file\r\n.tar.gz or .tar.Z or .tar.bz or .tar.bz2  -- file is a tar file\r\n               with compression (see suffixes above, e.g., gz)<\/pre>\n<h2>File extraction:<\/h2>\n<pre class=\"lang:sh decode:true\">file.tar              -- tar file w\/o compression\r\n   tar tvf file.tar   -- test the file [ALWAYS DO FIRST]\r\n   tar xvf file.tar   -- extract the file<\/pre>\n<pre class=\"lang:sh decode:true\">file.tar.gz or .tgz or .Z:\r\n   tar -tvzf file.tgz  -- test\r\n   tar -xvzf file.tgz  -- extract\r\n   tar -xvvzf archiv.tar.gz -- extract\r\n   gunzip -cd file.tgz | tar xvf -    -- use with older\r\n                                            non-zip aware TAR\r\n                                            (e.g., Solaris)<\/pre>\n<pre class=\"lang:sh decode:true\">file.bz:\r\n   bzip -cd file.bz | tar xvf -\r\n\r\nfile.bz2\r\n   bzip2 -cd file.bz | tar xvf -\r\n<\/pre>\n<h2>File creation:<\/h2>\n<pre class=\"lang:sh decode:true \">tar cvzf file.tgz [list of files to compress]\r\ntar cvf - [file list] | gzip &gt;file.tgz\r\ntar cvf - [file list] |  bzip2 &gt;file.tar.bz2\r\n\r\n<\/pre>\n<p>Use of TAR to copy a directory tree (with permissions, recursive, etc.):<\/p>\n<p>This should be a program like dircopy or xcopy<\/p>\n<pre class=\"lang:sh decode:true \">   cd source_directory\r\n   tar cvf - * |  ( cd dest_dir ; tar xvf - )\r\n<\/pre>\n<h1>Beispiel<\/h1>\n<p>Archive mit Inhalt von \/etc und \/home erstellen:<\/p>\n<pre class=\"lang:sh decode:true\">tar cvf test.tar \/etc\/ \/home\/\r\ntar cvf - \/etc \/home | gzip &gt; test.tar.gz\r\ntar czvf test.tar.gz \/etc\/ \/home\/         # *GNU tar* Kurzform\r\n<\/pre>\n<h2>Archive entpacken:<\/h2>\n<pre class=\"lang:sh decode:true \">tar xvf test.tar\r\ngunzip &lt; test.tar.gz | tar xvf -\r\ntar xzvf test.tar.gz                      # *GNU tar* Kurzform\r\n<\/pre>\n<h2>Archivinhalt ansehen:<\/h2>\n<pre class=\"lang:sh decode:true \">tar tvf test.tar\r\ngunzip &lt; test.tar.gz | tar tf -\r\ntar tzvf test.tar.gz                      # *GNU tar* Kurzform\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-linux"],"modified_by":"ralph","_links":{"self":[{"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=239"}],"version-history":[{"count":1,"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions"}],"predecessor-version":[{"id":240,"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions\/240"}],"wp:attachment":[{"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-metal.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}