{"id":13239,"date":"2019-04-01T09:07:02","date_gmt":"2019-04-01T09:07:02","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13239"},"modified":"2019-04-01T09:07:02","modified_gmt":"2019-04-01T09:07:02","slug":"5-best-command-line-archive-tools-for-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/5-best-command-line-archive-tools-for-linux\/","title":{"rendered":"5 Best Command Line Archive Tools for Linux"},"content":{"rendered":"<p>In our day-to-day life we come across, archived files on the platforms of all kind be it\u00a0<strong>Windows<\/strong>,\u00a0<strong>Mac<\/strong>\u00a0or\u00a0<strong>Linux<\/strong>. There are several Application program available for all of the platforms to create archive files as well as uncompress them. When it comes to work on Linux Platform, we need to deal with archived files very frequently.<\/p>\n<div id=\"attachment_6654\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/05\/Linux-Archive-Tools.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-6654\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/05\/Linux-Archive-Tools-620x387.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/05\/Linux-Archive-Tools-620x387.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/05\/Linux-Archive-Tools-1024x640.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/05\/Linux-Archive-Tools.jpeg 1440w\" alt=\"Linux Command Line Archive Tools\" width=\"620\" height=\"387\" aria-describedby=\"caption-attachment-6654\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-6654\" class=\"wp-caption-text\">Linux Command Line Archive Tools<\/p>\n<\/div>\n<p>Here in this article we will be discussing archive tools available on standard Linux Distribution, their features, Examples, etc. The article divided into two parts, each part contains five command line archive tools (i.e. total of\u00a0<strong>10 Best Command Line Archive Tools<\/strong>).<\/p>\n<h4>What is Archived file?<\/h4>\n<p>An archive file is a compressed file which is composed of one or more than one computer files along with metadata.<\/p>\n<h4>Features of Archiving<\/h4>\n<ol>\n<li>Data Compression<\/li>\n<li>Encryption<\/li>\n<li>File Concatenation<\/li>\n<li>Automatic Extraction<\/li>\n<li>Automatic Installation<\/li>\n<li>Source Volume and Media Information<\/li>\n<li>File Spanning<\/li>\n<li>Checksum<\/li>\n<li>Directory Structure Information<\/li>\n<li>Other Metadata (Data About Data)<\/li>\n<li>Error discovery<\/li>\n<\/ol>\n<h4>Area of Application<\/h4>\n<ol>\n<li>Store Computer Files System along with Metadata.<\/li>\n<li>Useful in transferring file locally.<\/li>\n<li>Useful in transferring file over web.<\/li>\n<li>Software Packaging Application.<\/li>\n<\/ol>\n<p>The useful archiving application on standard Linux distribution follows:<\/p>\n<h3>1. tar Command<\/h3>\n<p><strong>tar<\/strong>\u00a0is the standard UNIX\/Linux archiving application tool. In its early stage it used to be a Tape Archiving Program which gradually is developed into General Purpose archiving package which is capable of handling archive files of every kind. tar accepts a lot of archiving filter with options.<\/p>\n<h4>tar options<\/h4>\n<ol>\n<li><strong>-A<\/strong>\u00a0: Append tar files to existing archives.<\/li>\n<li><strong>-c<\/strong>\u00a0: Create a new archive file.<\/li>\n<li><strong>-d<\/strong>\u00a0: Compare archive with Specified filesystem.<\/li>\n<li><strong>-j<\/strong>\u00a0: bzip the archive<\/li>\n<li><strong>-r<\/strong>\u00a0: append files to existing archives.<\/li>\n<li><strong>-t<\/strong>\u00a0: list contents of existing archives.<\/li>\n<li><strong>-u<\/strong>\u00a0: Update archive<\/li>\n<li><strong>-x<\/strong>\u00a0: Extract file from existing archive.<\/li>\n<li><strong>-z<\/strong>\u00a0: gzip the archive<\/li>\n<li><strong>\u2013delete<\/strong>\u00a0: Delete files from existing archive.<\/li>\n<\/ol>\n<h5>tar Examples<\/h5>\n<p>Create a tar archive file.<\/p>\n<pre># tar -zcvf name_of_tar.tar.gz \/path\/to\/folder<\/pre>\n<p>Decompress an tar archive file.<\/p>\n<pre># tar -zxvf Name_of_tar_file.tar.gz<\/pre>\n<p>For more detailed examples, read\u00a0<a href=\"https:\/\/www.tecmint.com\/18-tar-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">18 Tar Command Examples in Linux<\/a>.<\/p>\n<h3>shar Command<\/h3>\n<p><strong>shar<\/strong>\u00a0which stands for\u00a0<strong>Shell<\/strong>\u00a0archive is a shell script, the execution of which will create the files. shar is a self-extracting archive file which is a legacy utility and needs\u00a0<strong>Unix Bourne Shell<\/strong>\u00a0to extract the files. shar has an advantage of being plain text however it is potentially dangerous, since it outputs an executable.<\/p>\n<h4>shar options<\/h4>\n<ol>\n<li><strong>-o<\/strong>\u00a0: Save output to archive files as specified, in the option.<\/li>\n<li><strong>-l<\/strong>\u00a0: Limit the output size, as specified, in the option but do not split it.<\/li>\n<li><strong>-L<\/strong>\u00a0: Limit the output size, as specified, in the option and split it.<\/li>\n<li><strong>-n<\/strong>\u00a0: Name of Archive to be included in the header of the shar files.<\/li>\n<li><strong>-a<\/strong>\u00a0: Allow automatic generation of headers.<\/li>\n<\/ol>\n<p><strong>Note<\/strong>: The \u2018<strong>-o<\/strong>\u2018 option is required if the \u2018<strong>-l<\/strong>\u2018 or \u2018<strong>-L<\/strong>\u2018 option is used and the \u2018<strong>-n<\/strong>\u2018 option is required if the \u2018<strong>-a<\/strong>\u2018 option is used.<\/p>\n<h5>shar Examples<\/h5>\n<p>Create a shar archive file.<\/p>\n<pre># shar file_name.extension &gt; filename.shar<\/pre>\n<p>Extract an shar archive file.<\/p>\n<pre># unshar file_name.shar<\/pre>\n<h3>3. ar Command<\/h3>\n<p><strong>ar<\/strong>\u00a0is the creation and manipulation utility for archives, mainly used for binary object file libraries. ar stands for archiver which can be used to create archive of any kind for any purpose but has largely been replaced by \u2018tar\u2019 and now-a-days it is used only to create and update static library files.<\/p>\n<h4>ar options<\/h4>\n<ol>\n<li><strong>-d<\/strong>\u00a0: Delete modules from the archive.<\/li>\n<li><strong>-m<\/strong>\u00a0: Move Members in the archive.<\/li>\n<li><strong>-p<\/strong>\u00a0: Print specified members of the archive.<\/li>\n<li><strong>-q<\/strong>\u00a0: Quick Append.<\/li>\n<li><strong>-r<\/strong>\u00a0: Insert file member to archive.<\/li>\n<li><strong>-s<\/strong>\u00a0: Add index to archive.<\/li>\n<li><strong>-a<\/strong>\u00a0: Add a new file to the existing members of archive.<\/li>\n<\/ol>\n<h5>ar Examples<\/h5>\n<p>Create an archive using \u2018<strong>ar<\/strong>\u2018 tool with a static library say \u2018<strong>libmath.a<\/strong>\u2018 with the objective files \u2018substraction\u2019 and \u2018division\u2019 as.<\/p>\n<pre># ar cr libmath.a substraction.o division.o<\/pre>\n<p>To extract an \u2018ar\u2019 archive file.<\/p>\n<pre># ar x libmath.a<\/pre>\n<h4>4. cpio<\/h4>\n<p><strong>cpio<\/strong>\u00a0stands for\u00a0<strong>Copy in and out<\/strong>. Cpio is a general purpose file archiver for Linux. It is actively used by\u00a0<strong>RedHat<\/strong><strong>Package Manager<\/strong>\u00a0(RPM) and in the\u00a0<strong>initramfs<\/strong>\u00a0of Linux Kernel as well as an important archiving tool in\u00a0<strong>Apple Computer\u2019s Installer<\/strong>\u00a0(pax).<\/p>\n<h4>cpio options<\/h4>\n<ol>\n<li><strong>-0<\/strong>\u00a0: Read a list of filenames terminated by a null character instead of a newline.<\/li>\n<li><strong>-a<\/strong>\u00a0: Reset Access time.<\/li>\n<li><strong>-A<\/strong>\u00a0: Append.<\/li>\n<li><strong>-b<\/strong>\u00a0: swap.<\/li>\n<li><strong>-d<\/strong>\u00a0: Make Directories.<\/li>\n<\/ol>\n<h5>cpio Examples<\/h5>\n<p>Create an \u2018cpio\u2019 archive file.<\/p>\n<pre># cd tecmint\r\n# ls\r\n\r\nfile1.o file2.o file3.o\r\n\r\n# ls | cpio  -ov &gt; \/path\/to\/output_folder\/obj.cpio<\/pre>\n<p>To extract a cpio archive file.<\/p>\n<pre># cpio -idv &lt; \/path\/to folder\/obj.cpio<\/pre>\n<h3>5. Gzip<\/h3>\n<p><strong>gzip<\/strong>\u00a0is standard and widely used file compression and decompression utility. Gzip allows file concatenation. Compressing the file with gzip, outputs the tarball which is in the format of \u2018*<strong>.tar.gz<\/strong>\u2018 or \u2018<strong>*.tgz<\/strong>\u2018.<\/p>\n<h4>gzip options<\/h4>\n<ol>\n<li><strong>\u2013stdout<\/strong>\u00a0: Produce output on standard output.<\/li>\n<li><strong>\u2013to-stdout<\/strong>\u00a0: Produce output on standard output.<\/li>\n<li><strong>\u2013decompress<\/strong>\u00a0: Decompress File.<\/li>\n<li><strong>\u2013uncompress<\/strong>\u00a0: Decompress File.<\/li>\n<li><strong>-d<\/strong>\u00a0: Decompress File.<\/li>\n<li><strong>-f<\/strong>\u00a0: Force Compression\/Decompression.<\/li>\n<\/ol>\n<h5>gzip Examples<\/h5>\n<p>Create an \u2018gzip\u2019 archive file.<\/p>\n<pre># tar -cvzf name_of_archive.tar.gz \/path\/to\/folder<\/pre>\n<p>To extract a \u2018gzip\u2019 archive file.<\/p>\n<pre># gunzip file_name.tar.gz<\/pre>\n<p>The above command must be passed followed with below command.<\/p>\n<pre># tar -xvf file_name.tar<\/pre>\n<p><strong>Note<\/strong>: The architecture and functionality of \u2018gzip\u2019 makes it difficult to recover corrupted \u2018gzipped tar archive\u2019 file. It is advised to make several backups of gzipped Important files, at different Locations.<\/p>\n<p>That\u2019s all for now.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/command-line-archive-tools-for-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our day-to-day life we come across, archived files on the platforms of all kind be it\u00a0Windows,\u00a0Mac\u00a0or\u00a0Linux. There are several Application program available for all of the platforms to create archive files as well as uncompress them. When it comes to work on Linux Platform, we need to deal with archived files very frequently. Linux &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/5-best-command-line-archive-tools-for-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;5 Best Command Line Archive Tools for Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13239","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13239"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13239\/revisions"}],"predecessor-version":[{"id":13240,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13239\/revisions\/13240"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}