{"id":11448,"date":"2019-03-14T07:52:23","date_gmt":"2019-03-14T07:52:23","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11448"},"modified":"2019-03-14T07:52:23","modified_gmt":"2019-03-14T07:52:23","slug":"18-tar-command-examples-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/14\/18-tar-command-examples-in-linux\/","title":{"rendered":"18 Tar Command Examples in Linux"},"content":{"rendered":"<p>The Linux \u201c<strong>tar<\/strong>\u201d stands for tape archive, which is used by large number of\u00a0<strong>Linux\/Unix<\/strong>\u00a0system administrators to deal with tape drives backup. The tar command used to rip a collection of files and directories into highly compressed archive file commonly called\u00a0<strong>tarball<\/strong>\u00a0or\u00a0<strong>tar<\/strong>,\u00a0<strong>gzip<\/strong>\u00a0and\u00a0<strong>bzip<\/strong>\u00a0in\u00a0<strong>Linux<\/strong>. The tar is most widely used command to create compressed archive files and that can be moved easily from one disk to another disk or machine to machine.<\/p>\n<div id=\"attachment_1063\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/09\/18-Linux-Tar-Command-Examples.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1063\" title=\"Linux Tar Command Examples\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/09\/18-Linux-Tar-Command-Examples.png\" alt=\"Linux Tar Command Examples\" width=\"300\" height=\"221\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Linux Tar Command Examples<\/p>\n<\/div>\n<p>In this article we will be going to review and discuss various\u00a0<strong>tar command examples<\/strong>\u00a0including how to create archive files using (<strong>tar<\/strong>,\u00a0<strong>tar.gz<\/strong>\u00a0and\u00a0<strong>tar.bz2<\/strong>) compression, how to extract archive file, extract a single file, view content of file, verify a file, add files or directories to archive file, estimate the size of tar archive file, etc.<\/p>\n<p>The main purpose of this guide is to provide various\u00a0<strong>tar command examples<\/strong>\u00a0that might be helpful for you to understand and become expert in tar archive manipulation.<br \/>\n<span id=\"more-1062\"><\/span><\/p>\n<h4>1. Create tar Archive File<\/h4>\n<p>The below example command will create a\u00a0<strong>tar<\/strong>\u00a0archive file\u00a0<strong>tecmint-14-09-12.tar<\/strong>\u00a0for a directory\u00a0<strong>\/home\/tecmint<\/strong>\u00a0in current working directory. See the example command in action.<\/p>\n<pre><strong># tar -cvf tecmint-14-09-12.tar \/home\/tecmint\/<\/strong>\r\n\r\n\/home\/tecmint\/\r\n\/home\/tecmint\/cleanfiles.sh\r\n\/home\/tecmint\/openvpn-2.1.4.tar.gz\r\n\/home\/tecmint\/tecmint-14-09-12.tar\r\n\/home\/tecmint\/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm\r\n\/home\/tecmint\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm<\/pre>\n<p>Let\u2019s discuss each option that we have used in the above command for creating a tar archive file.<\/p>\n<ol>\n<li><strong>c<\/strong>\u00a0\u2013 Creates a new .tar archive file.<\/li>\n<li><strong>v<\/strong>\u00a0\u2013 Verbosely show the .tar file progress.<\/li>\n<li><strong>f<\/strong>\u00a0\u2013 File name type of the archive file.<\/li>\n<\/ol>\n<h4>2. Create tar.gz Archive File<\/h4>\n<p>To create a compressed\u00a0<strong>gzip<\/strong>\u00a0archive file we use the option as\u00a0<strong>z<\/strong>. For example the below command will create a compressed\u00a0<strong>MyImages-14-09-12.tar.gz<\/strong>\u00a0file for the directory\u00a0<strong>\/home\/MyImages<\/strong>. (<strong>Note : tar.gz and tgz both are similar<\/strong>).<\/p>\n<pre><strong># tar cvzf MyImages-14-09-12.tar.gz \/home\/MyImages<\/strong>\r\nOR\r\n<strong># tar cvzf MyImages-14-09-12.tgz \/home\/MyImages<\/strong>\r\n\r\n\/home\/MyImages\/\r\n\/home\/MyImages\/Sara-Khan-and-model-Priyanka-Shah.jpg\r\n\/home\/MyImages\/RobertKristenviolent101201.jpg\r\n\/home\/MyImages\/Justintimerlake101125.jpg\r\n\/home\/MyImages\/Mileyphoto101203.jpg\r\n\/home\/MyImages\/JenniferRobert101130.jpg\r\n\/home\/MyImages\/katrinabarbiedoll231110.jpg\r\n\/home\/MyImages\/the-japanese-wife-press-conference.jpg\r\n\/home\/MyImages\/ReesewitherspoonCIA101202.jpg\r\n\/home\/MyImages\/yanaguptabaresf231110.jpg<\/pre>\n<h4>3. Create tar.bz2 Archive File<\/h4>\n<p>The\u00a0<strong>bz2<\/strong>\u00a0feature compress and create archive file less than the size of the\u00a0<strong>gzip<\/strong>. The\u00a0<strong>bz2<\/strong>\u00a0compression takes more time to compress and decompress files as compared to\u00a0<strong>gzip<\/strong>\u00a0which takes less time. To create highly compressed tar file we use option as\u00a0<strong>j<\/strong>. The following example command will create a\u00a0<strong>Phpfiles-org.tar.bz2<\/strong>\u00a0file for a directory\u00a0<strong>\/home\/php<\/strong>. (<strong>Note: tar.bz2 and tbz is similar as tb2<\/strong>).<\/p>\n<pre><strong># tar cvfj Phpfiles-org.tar.bz2 \/home\/php<\/strong>\r\nOR\r\n<strong># tar cvfj Phpfiles-org.tar.tbz \/home\/php<\/strong>\r\nOR \r\n<strong># tar cvfj Phpfiles-org.tar.tb2 \/home\/php<\/strong>\r\n\r\n\/home\/php\/\r\n\/home\/php\/iframe_ew.php\r\n\/home\/php\/videos_all.php\r\n\/home\/php\/rss.php\r\n\/home\/php\/index.php\r\n\/home\/php\/vendor.php\r\n\/home\/php\/video_title.php\r\n\/home\/php\/report.php\r\n\/home\/php\/object.html\r\n\/home\/php\/video.php<\/pre>\n<h4>4. Untar tar Archive File<\/h4>\n<p>To untar or extract a tar file, just issue following command using option\u00a0<strong>x<\/strong>\u00a0(<strong>extract<\/strong>). For example the below command will untar the file\u00a0<strong>public_html-14-09-12.tar<\/strong>\u00a0in present working directory. If you want to untar in a different directory then use option as\u00a0<strong>-C<\/strong>\u00a0(<strong>specified directory<\/strong>).<\/p>\n<pre><strong>## Untar files in Current Directory ##<\/strong>\r\n<strong># tar -xvf public_html-14-09-12.tar<\/strong>\r\n\r\n<strong>## Untar files in specified Directory ##<\/strong>\r\n<strong># tar -xvf public_html-14-09-12.tar -C \/home\/public_html\/videos\/<\/strong>\r\n\r\n\/home\/public_html\/videos\/\r\n\/home\/public_html\/videos\/views.php\r\n\/home\/public_html\/videos\/index.php\r\n\/home\/public_html\/videos\/logout.php\r\n\/home\/public_html\/videos\/all_categories.php\r\n\/home\/public_html\/videos\/feeds.xml<\/pre>\n<h4>5. Uncompress tar.gz Archive File<\/h4>\n<p>To Uncompress\u00a0<strong>tar.gz<\/strong>\u00a0archive file, just run following command. If would like to untar in different directory just use option\u00a0<strong>-C<\/strong>\u00a0and the path of the directory,\u00a0 like we shown in the above example.<\/p>\n<pre><strong># tar -xvf thumbnails-14-09-12.tar.gz<\/strong>\r\n\r\n\/home\/public_html\/videos\/thumbnails\/\r\n\/home\/public_html\/videos\/thumbnails\/katdeepika231110.jpg\r\n\/home\/public_html\/videos\/thumbnails\/katrinabarbiedoll231110.jpg\r\n\/home\/public_html\/videos\/thumbnails\/onceuponatime101125.jpg\r\n\/home\/public_html\/videos\/thumbnails\/playbutton.png\r\n\/home\/public_html\/videos\/thumbnails\/ReesewitherspoonCIA101202.jpg\r\n\/home\/public_html\/videos\/thumbnails\/snagItNarration.jpg\r\n\/home\/public_html\/videos\/thumbnails\/Minissha-Lamba.jpg\r\n\/home\/public_html\/videos\/thumbnails\/Lindsaydance101201.jpg\r\n\/home\/public_html\/videos\/thumbnails\/Mileyphoto101203.jpg<\/pre>\n<h4>6. Uncompress tar.bz2 Archive File<\/h4>\n<p>To Uncompress highly compressed\u00a0<strong>tar.bz2<\/strong>\u00a0file, just use the following command. The below example command will untar all the\u00a0<strong>.flv<\/strong>\u00a0files from the archive file.<\/p>\n<pre># tar -xvf videos-14-09-12.tar.bz2\r\n\r\n\/home\/public_html\/videos\/flv\/katrinabarbiedoll231110.flv\r\n\/home\/public_html\/videos\/flv\/BrookmuellerCIA101125.flv\r\n\/home\/public_html\/videos\/flv\/dollybackinbb4101125.flv\r\n\/home\/public_html\/videos\/flv\/JenniferRobert101130.flv\r\n\/home\/public_html\/videos\/flv\/JustinAwardmovie101125.flv\r\n\/home\/public_html\/videos\/flv\/Lakme-Fashion-Week.flv\r\n\/home\/public_html\/videos\/flv\/Mileyphoto101203.flv\r\n\/home\/public_html\/videos\/flv\/Minissha-Lamba.flv<\/pre>\n<h4>7. List Content of tar Archive File<\/h4>\n<p>To list the contents of tar archive file, just run the following command with option\u00a0<strong>t<\/strong>\u00a0(<strong>list content<\/strong>). The below command will list the content of\u00a0<strong>uploadprogress.tar<\/strong>\u00a0file.<\/p>\n<pre><strong># tar -tvf uploadprogress.tar<\/strong>\r\n\r\n-rw-r--r-- chregu\/staff   2276 2011-08-15 18:51:10 package2.xml\r\n-rw-r--r-- chregu\/staff   7877 2011-08-15 18:51:10 uploadprogress\/examples\/index.php\r\n-rw-r--r-- chregu\/staff   1685 2011-08-15 18:51:10 uploadprogress\/examples\/server.php\r\n-rw-r--r-- chregu\/staff   1697 2011-08-15 18:51:10 uploadprogress\/examples\/info.php\r\n-rw-r--r-- chregu\/staff    367 2011-08-15 18:51:10 uploadprogress\/config.m4\r\n-rw-r--r-- chregu\/staff    303 2011-08-15 18:51:10 uploadprogress\/config.w32\r\n-rw-r--r-- chregu\/staff   3563 2011-08-15 18:51:10 uploadprogress\/php_uploadprogress.h\r\n-rw-r--r-- chregu\/staff  15433 2011-08-15 18:51:10 uploadprogress\/uploadprogress.c\r\n-rw-r--r-- chregu\/staff   1433 2011-08-15 18:51:10 package.xml<\/pre>\n<h4>8. List Content tar.gz Archive File<\/h4>\n<p>Use the following command to list the content of\u00a0<strong>tar.gz<\/strong>\u00a0file.<\/p>\n<pre><strong># tar -tvf staging.tecmint.com.tar.gz<\/strong>\r\n\r\n-rw-r--r-- root\/root         0 2012-08-30 04:03:57 staging.tecmint.com-access_log\r\n-rw-r--r-- root\/root       587 2012-08-29 18:35:12 staging.tecmint.com-access_log.1\r\n-rw-r--r-- root\/root       156 2012-01-21 07:17:56 staging.tecmint.com-access_log.2\r\n-rw-r--r-- root\/root       156 2011-12-21 11:30:56 staging.tecmint.com-access_log.3\r\n-rw-r--r-- root\/root       156 2011-11-20 17:28:24 staging.tecmint.com-access_log.4\r\n-rw-r--r-- root\/root         0 2012-08-30 04:03:57 staging.tecmint.com-error_log\r\n-rw-r--r-- root\/root      3981 2012-08-29 18:35:12 staging.tecmint.com-error_log.1\r\n-rw-r--r-- root\/root       211 2012-01-21 07:17:56 staging.tecmint.com-error_log.2\r\n-rw-r--r-- root\/root       211 2011-12-21 11:30:56 staging.tecmint.com-error_log.3\r\n-rw-r--r-- root\/root       211 2011-11-20 17:28:24 staging.tecmint.com-error_log.4<\/pre>\n<h4>9. List Content tar.bz2 Archive File<\/h4>\n<p>To list the content of\u00a0<strong>tar.bz2<\/strong>\u00a0file, issue the following command.<\/p>\n<pre><strong># tar -tvf Phpfiles-org.tar.bz2<\/strong>\r\n\r\ndrwxr-xr-x root\/root         0 2012-09-15 03:06:08 \/home\/php\/\r\n-rw-r--r-- root\/root      1751 2012-09-15 03:06:08 \/home\/php\/iframe_ew.php\r\n-rw-r--r-- root\/root     11220 2012-09-15 03:06:08 \/home\/php\/videos_all.php\r\n-rw-r--r-- root\/root      2152 2012-09-15 03:06:08 \/home\/php\/rss.php\r\n-rw-r--r-- root\/root      3021 2012-09-15 03:06:08 \/home\/php\/index.php\r\n-rw-r--r-- root\/root      2554 2012-09-15 03:06:08 \/home\/php\/vendor.php\r\n-rw-r--r-- root\/root       406 2012-09-15 03:06:08 \/home\/php\/video_title.php\r\n-rw-r--r-- root\/root      4116 2012-09-15 03:06:08 \/home\/php\/report.php\r\n-rw-r--r-- root\/root      1273 2012-09-15 03:06:08 \/home\/php\/object.html<\/pre>\n<h4>10. Untar Single file from tar File<\/h4>\n<p>To extract a single file called\u00a0<strong>cleanfiles.sh<\/strong>\u00a0from\u00a0<strong>cleanfiles.sh.tar<\/strong>\u00a0use the following command.<\/p>\n<pre><strong># tar -xvf cleanfiles.sh.tar cleanfiles.sh<\/strong>\r\nOR\r\n<strong># tar --extract --file=cleanfiles.sh.tar cleanfiles.sh<\/strong>\r\n\r\ncleanfiles.sh<\/pre>\n<h4>11. Untar Single file from tar.gz File<\/h4>\n<p>To extract a single file\u00a0<strong>tecmintbackup.xml<\/strong>\u00a0from\u00a0<strong>tecmintbackup.tar.gz<\/strong>\u00a0archive file, use the command as follows.<\/p>\n<pre><strong># tar -zxvf tecmintbackup.tar.gz tecmintbackup.xml<\/strong>\r\nOR\r\n<strong># tar --extract --file=tecmintbackup.tar.gz tecmintbackup.xml<\/strong>\r\n\r\ntecmintbackup.xml<\/pre>\n<h4>12. Untar Single file from tar.bz2 File<\/h4>\n<p>To extract a single file called\u00a0<strong>index.php<\/strong>\u00a0from the file\u00a0<strong>Phpfiles-org.tar.bz2<\/strong>\u00a0use the following option.<\/p>\n<pre><strong># tar -jxvf Phpfiles-org.tar.bz2 home\/php\/index.php<\/strong>\r\nOR\r\n<strong># tar --extract --file=Phpfiles-org.tar.bz2 \/home\/php\/index.php<\/strong>\r\n\r\n\/home\/php\/index.php<\/pre>\n<h4>13. Untar Multiple files from tar, tar.gz and tar.bz2 File<\/h4>\n<p>To extract or untar multiple files from the\u00a0<strong>tar<\/strong>,\u00a0<strong>tar.gz<\/strong>\u00a0and\u00a0<strong>tar.bz2<\/strong>\u00a0archive file. For example the below command will extract \u201c<strong>file 1<\/strong>\u201d \u201c<strong>file 2<\/strong>\u201d from the archive files.<\/p>\n<pre><strong># tar -xvf tecmint-14-09-12.tar \"file 1\" \"file 2\"<\/strong> \r\n\r\n<strong># tar -zxvf MyImages-14-09-12.tar.gz \"file 1\" \"file 2\"<\/strong> \r\n\r\n<strong># tar -jxvf Phpfiles-org.tar.bz2 \"file 1\" \"file 2\"<\/strong><\/pre>\n<h4>14. Extract Group of Files using Wildcard<\/h4>\n<p>To extract a group of files we use\u00a0<strong>wildcard<\/strong>\u00a0based extracting. For example, to extract a group of all files whose pattern begins with\u00a0<strong>.php<\/strong>\u00a0from a\u00a0<strong>tar, tar.gz and tar.bz2<\/strong>\u00a0archive file.<\/p>\n<pre><strong># tar -xvf Phpfiles-org.tar --wildcards '*.php'<\/strong>\r\n\r\n<strong># tar -zxvf Phpfiles-org.tar.gz --wildcards '*.php'<\/strong>\r\n\r\n<strong># tar -jxvf Phpfiles-org.tar.bz2 --wildcards '*.php'<\/strong>\r\n\r\n\/home\/php\/iframe_ew.php\r\n\/home\/php\/videos_all.php\r\n\/home\/php\/rss.php\r\n\/home\/php\/index.php\r\n\/home\/php\/vendor.php\r\n\/home\/php\/video_title.php\r\n\/home\/php\/report.php\r\n\/home\/php\/video.php<\/pre>\n<h4>15. Add Files or Directories to tar Archive File<\/h4>\n<p>To add files or directories to existing tar archived file we use the option\u00a0<strong>r<\/strong>\u00a0(<strong>append<\/strong>). For example we add file\u00a0<strong>xyz.txt<\/strong>\u00a0and directory\u00a0<strong>php<\/strong>\u00a0to existing\u00a0<strong>tecmint-14-09-12.tar<\/strong>\u00a0archive file.<\/p>\n<pre><strong># tar -rvf tecmint-14-09-12.tar xyz.txt<\/strong>\r\n\r\n<strong># tar -rvf tecmint-14-09-12.tar php<\/strong>\r\n\r\ndrwxr-xr-x root\/root         0 2012-09-15 02:24:21 home\/tecmint\/\r\n-rw-r--r-- root\/root  15740615 2012-09-15 02:23:42 home\/tecmint\/cleanfiles.sh\r\n-rw-r--r-- root\/root    863726 2012-09-15 02:23:41 home\/tecmint\/openvpn-2.1.4.tar.gz\r\n-rw-r--r-- root\/root  21063680 2012-09-15 02:24:21 home\/tecmint\/tecmint-14-09-12.tar\r\n-rw-r--r-- root\/root   4437600 2012-09-15 02:23:41 home\/tecmint\/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm\r\n-rw-r--r-- root\/root     12680 2012-09-15 02:23:41 home\/tecmint\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm\r\n<strong>-rw-r--r-- root\/root 0 2012-08-18 19:11:04 xyz.txt<\/strong>\r\n<strong>drwxr-xr-x root\/root 0 2012-09-15 03:06:08 php\/ \r\n-rw-r--r-- root\/root 1751 2012-09-15 03:06:08 php\/iframe_ew.php \r\n-rw-r--r-- root\/root 11220 2012-09-15 03:06:08 php\/videos_all.php \r\n-rw-r--r-- root\/root 2152 2012-09-15 03:06:08 php\/rss.php \r\n-rw-r--r-- root\/root 3021 2012-09-15 03:06:08 php\/index.php \r\n-rw-r--r-- root\/root 2554 2012-09-15 03:06:08 php\/vendor.php \r\n-rw-r--r-- root\/root 406 2012-09-15 03:06:08 php\/video_title.php<\/strong><\/pre>\n<h4>16. Add Files or Directories to tar.gz and tar.bz2 files<\/h4>\n<p>The tar command don\u2019t have a option to add files or directories to an existing compressed\u00a0<strong>tar.gz<\/strong>\u00a0and\u00a0<strong>tar.bz2<\/strong>archive file. If we do try will get the following error.<\/p>\n<pre><strong># tar -rvf MyImages-14-09-12.tar.gz xyz.txt<\/strong>\r\n\r\n<strong># tar -rvf Phpfiles-org.tar.bz2 xyz.txt<\/strong>\r\n\r\ntar: This does not look like a tar archive\r\ntar: Skipping to next header\r\nxyz.txt\r\ntar: Error exit delayed from previous errors<\/pre>\n<h4>17. How To Verify tar, tar.gz and tar.bz2 Archive File<\/h4>\n<p>To verfify any tar or compressed archived file we use option as\u00a0<strong>W<\/strong>\u00a0(<strong>verify<\/strong>). To do, just use the following examples of command. (<strong>Note :<\/strong>\u00a0You cannot do verification on a compressed (\u00a0<strong>*.tar.gz, *.tar.bz2<\/strong>\u00a0) archive file).<\/p>\n<pre><strong># tar tvfW tecmint-14-09-12.tar<\/strong>\r\n\r\ntar: This does not look like a tar archive\r\ntar: Skipping to next header\r\ntar: Archive contains obsolescent base-64 headers\r\ntar: VERIFY FAILURE: 30740 invalid headers detected\r\nVerify -rw-r--r-- root\/root    863726 2012-09-15 02:23:41 \/home\/tecmint\/openvpn-2.1.4.tar.gz\r\nVerify -rw-r--r-- root\/root  21063680 2012-09-15 02:24:21 \/home\/tecmint\/tecmint-14-09-12.tar\r\ntar: \/home\/tecmint\/tecmint-14-09-12.tar: Warning: Cannot stat: No such file or directory\r\nVerify -rw-r--r-- root\/root   4437600 2012-09-15 02:23:41 home\/tecmint\/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm\r\ntar: \/home\/tecmint\/phpmyadmin-2.11.11.3-1.el5.rf.noarch.rpm: Warning: Cannot stat: No such file or directory\r\nVerify -rw-r--r-- root\/root     12680 2012-09-15 02:23:41 home\/tecmint\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm\r\ntar: \/home\/tecmint\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm: Warning: Cannot stat: No such file or directory\r\nVerify -rw-r--r-- root\/root         0 2012-08-18 19:11:04 xyz.txt\r\nVerify drwxr-xr-x root\/root         0 2012-09-15 03:06:08 php\/<\/pre>\n<h4>18. Check the Size of the tar, tar.gz and tar.bz2 Archive File<\/h4>\n<p>To check the size of any\u00a0<strong>tar<\/strong>,\u00a0<strong>tar.gz<\/strong>\u00a0and\u00a0<strong>tar.bz2<\/strong>\u00a0archive file, use the following command. For example the below command will display the size of archive file in Kilobytes (<strong>KB<\/strong>).<\/p>\n<pre><strong># tar -czf - tecmint-14-09-12.tar | wc -c<\/strong>\r\n12820480\r\n\r\n<strong># tar -czf - MyImages-14-09-12.tar.gz | wc -c<\/strong>\r\n112640\r\n\r\n<strong># tar -czf - Phpfiles-org.tar.bz2 | wc -c<\/strong>\r\n20480<\/pre>\n<h4>Tar Usage and Options<\/h4>\n<ol>\n<li><strong>c<\/strong>\u00a0\u2013 create a archive file.<\/li>\n<li><strong>x<\/strong>\u00a0\u2013 extract a archive file.<\/li>\n<li><strong>v<\/strong>\u00a0\u2013 show the progress of archive file.<\/li>\n<li><strong>f<\/strong>\u00a0\u2013 filename of archive file.<\/li>\n<li><strong>t<\/strong>\u00a0\u2013 viewing content of archive file.<\/li>\n<li><strong>j<\/strong>\u00a0\u2013 filter archive through bzip2.<\/li>\n<li><strong>z<\/strong>\u00a0\u2013 filter archive through gzip.<\/li>\n<li><strong>r<\/strong>\u00a0\u2013 append or update files or directories to existing archive file.<\/li>\n<li><strong>W<\/strong>\u00a0\u2013 Verify a archive file.<\/li>\n<li><strong>wildcards<\/strong>\u00a0\u2013 Specify patterns in unix tar command.<\/li>\n<\/ol>\n<p>That\u2019s it for now, hope the above\u00a0<strong>tar command examples<\/strong>\u00a0are enough for you to learn and for more information please use\u00a0<strong>man tar<\/strong>\u00a0command.<\/p>\n<p>If you are looking to split any large tar archive file into multiple parts or blocks, just go through this article:<\/p>\n<p><b>Don\u2019t Miss:<\/b>\u00a0<a href=\"https:\/\/www.tecmint.com\/split-large-tar-into-multiple-files-of-certain-size\/\" target=\"_blank\" rel=\"noopener\">Split Large \u2018tar\u2019 Archive into Multiple Files of Certain Size<\/a><\/p>\n<p>If we\u2019ve missed any example please do share with us via comment box and please don\u2019t forget to share this article with your friends. This is the best way to say thanks\u2026..<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/18-tar-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Linux \u201ctar\u201d stands for tape archive, which is used by large number of\u00a0Linux\/Unix\u00a0system administrators to deal with tape drives backup. The tar command used to rip a collection of files and directories into highly compressed archive file commonly called\u00a0tarball\u00a0or\u00a0tar,\u00a0gzip\u00a0and\u00a0bzip\u00a0in\u00a0Linux. The tar is most widely used command to create compressed archive files and that can &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/14\/18-tar-command-examples-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;18 Tar Command Examples in 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-11448","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\/11448","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=11448"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11448\/revisions"}],"predecessor-version":[{"id":11449,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11448\/revisions\/11449"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}