{"id":1704,"date":"2020-10-02T05:00:32","date_gmt":"2020-10-02T05:00:32","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=1704"},"modified":"2025-08-22T03:58:32","modified_gmt":"2025-08-22T03:58:32","slug":"how-to-create-tar-gz-file-in-linux","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/","title":{"rendered":"How to Create tar.gz file in Linux"},"content":{"rendered":"\n<p>The tar command in Linux allows you to compress files and directories into tar.gz files, also known as tarballs. They are very useful in data archival, compression and distribution. Here&#8217;s how to create tar.gz file in Linux. We will also learn how to extract a given tar.gz file.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#How_to_create_tarball_in_Linux\" >How to create tarball in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#Create_Tarball_from_Single_File\" >Create Tarball from Single File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#Tar_Multiple_Files\" >Tar Multiple Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#How_to_create_a_targz_file_from_a_directory\" >How to create a tar.gz file from a directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#Create_targz_from_multiple_folders\" >Create tar.gz from multiple folders<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#Create_tarball_from_files_and_folders\" >Create tarball from files and folders<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#How_to_Extract_targz_file_to_current_directory\" >How to Extract tar.gz file to current directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#Extract_targz_file_to_specific_directory\" >Extract tar.gz file to specific directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_create_tarball_in_Linux\"><\/span>How to create tarball in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We will use the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tar_(computing)\" target=\"_blank\" rel=\"noreferrer noopener\">tar<\/a> command to create tar.gz file in Linux. Here&#8217;s the syntax<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf filename.tar.gz \/path\/to\/file [paths to more files\/directories]\nOR\n$ tar -cvzf filename.tar.gz \/path\/to\/directory [paths to more files\/directories]<\/pre>\n\n\n\n<p>In the above command, the tar command is followed by options -cvzf, the filename of final tar.gz file to be created, followed by one or more paths to files\/directories<\/p>\n\n\n\n<p>In the above command we mention the following options<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>c &#8211; creation of archive file<\/li>\n\n\n\n<li>v &#8211; for verbose, meaning it will display the progress in terminal<\/li>\n\n\n\n<li>z &#8211; gzip the archived .tar file<\/li>\n\n\n\n<li>f  &#8211; filename of archive file<\/li>\n\n\n\n<li><\/li>\n<\/ul>\n\n\n\n<p><strong>Please note<\/strong>: Tar command used without -z option will only archive your file and create a .tar file. If you want it to be further compressed using gzip algorithm, you need to include -z option. In this case, it will create .tar.gz file. That is why you see a chained extension .tar.gz or .tar.bz2 in tarballs.<\/p>\n\n\n\n<p>Let us look at a few examples to create tar.gz file<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Tarball_from_Single_File\"><\/span>Create Tarball from Single File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s the command to create tar.gz file (e.g sales_data.tar.gz) from a single  file (e.g \/home\/ubuntu\/sales_data.txt)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf sales_data.tar.gz \/home\/ubuntu\/sales_data.txt<\/pre>\n\n\n\n<p>First tar command will create the archive .tar file and then compress it to create .tar.gz file. That is why you see 2 file extensions in a tarball.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tar_Multiple_Files\"><\/span>Tar Multiple Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you want to create a single tar.gz file from multiple files, just mention them one after the other in a space separated format, at the end of tar command as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf sales_data.tar.gz sales1.txt sales2.txt sales3.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_create_a_targz_file_from_a_directory\"><\/span>How to create a tar.gz file from a directory<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s the tar command to create tar.gz file from a directory (e.g \/home\/ubuntu\/product\/)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf product.tar.gz \/home\/ubuntu\/product\/\n\/home\/ubuntu\/product\/\n\/home\/ubuntu\/product\/file1.txt\n\/home\/ubuntu\/product\/file2.exe\n\/home\/ubuntu\/product\/file3.pdf<\/pre>\n\n\n\n<p>tar command will list contents of your directory that is being archived. The tar file will be created in present working directory.<\/p>\n\n\n\n<p>If you want to create the tar.gz file in a specific directory, mention the full path to tar.gz file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf \/home\/data\/product.tar.gz \/home\/ubuntu\/product\/<br>\/home\/ubuntu\/product\/<br>\/home\/ubuntu\/product\/file1.txt<br>\/home\/ubuntu\/product\/file2.exe<br>\/home\/ubuntu\/product\/file3.pdf<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_targz_from_multiple_folders\"><\/span>Create tar.gz from multiple folders<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can even create tar file from multiple directories by mentioning them one after the other in a space-delimited format as shown.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf \/home\/data\/product.tar.gz \/home\/ubuntu\/folder1\/ \/home\/ubuntu\/folder2\/<br>\/home\/ubuntu\/product\/<br>\/home\/ubuntu\/product\/file1.txt<br>\/home\/ubuntu\/product\/file2.exe<br>\/home\/ubuntu\/product\/file3.pdf<br>...<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_tarball_from_files_and_folders\"><\/span>Create tarball from files and folders<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also compress files and folders together by listing them one after the other in a space separated format.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -cvzf \/home\/data\/product.tar.gz \/home\/ubuntu\/folder1\/ \/home\/ubuntu\/data.txt<br>\/home\/ubuntu\/product\/<br>\/home\/ubuntu\/product\/file1.txt<br>\/home\/ubuntu\/product\/file2.exe<br>\/home\/ubuntu\/product\/file3.pdf<br>...<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Extract_targz_file_to_current_directory\"><\/span>How to Extract tar.gz file to current directory<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s the command to extract tar.gz file to current working directory<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -xvf product.tar.gz\n\/home\/ubuntu\/product\/\n\/home\/ubuntu\/product\/file1.txt\n\/home\/ubuntu\/product\/file2.exe\n\/home\/ubuntu\/product\/file3.pdf<\/pre>\n\n\n\n<p>tar command will list the contents of your tar.gz file that is being extracted.<\/p>\n\n\n\n<p>In the above command, we use -x option for extraction, instead of using -c for compression. Other options are same as above. You do not need to use it if you have only archived the file and created .tar file without compressing it into .tar.gz file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extract_targz_file_to_specific_directory\"><\/span>Extract tar.gz file to specific directory<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s the command to extract files to a specific directory (e.g \/home\/ubuntu\/data). You need to mention full path to destination directory after tar.gz command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -xvf filename.tar.gz \/path\/to\/dir<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -xvf product.tar.gz \/home\/ubuntu\/data<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to create tar.gz file from files and folders, in current directory as well as another directory. We have also learnt how to extract tar.gz file. Hopefully, the above tutorial will help you create tarball as well as extract tar.gz files in Linux.<\/p>\n\n\n\n<p><a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a> today!<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/linux-list-processes-name-user-pid\/\">How to List All Processes in Linux<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/search-file-linux\/\">How to Search File in Linux<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/get-disk-space-linux-unix\/\">How to Get Disk Space in Linux<\/a><br><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tar command in linux allow you to compress files and directories into tar.gz files known as tarballs. Here&#8217;s how to create tar.gz files in linux.<\/p>\n","protected":false},"author":1,"featured_media":1714,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[110],"tags":[190,189],"class_list":["post-1704","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-archive","tag-tarball"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create tar.gz file in Linux - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Tar command in linux allow you to compress files &amp; directories into tar.gz files known as tarballs. Here&#039;s how to create tar.gz file in linux.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create tar.gz file in Linux - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Tar command in linux allow you to compress files &amp; directories into tar.gz files known as tarballs. Here&#039;s how to create tar.gz file in linux.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-02T05:00:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-22T03:58:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"650\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Create tar.gz file in Linux\",\"datePublished\":\"2020-10-02T05:00:32+00:00\",\"dateModified\":\"2025-08-22T03:58:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/\"},\"wordCount\":654,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1\",\"keywords\":[\"archive\",\"tarball\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/\",\"name\":\"How to Create tar.gz file in Linux - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1\",\"datePublished\":\"2020-10-02T05:00:32+00:00\",\"dateModified\":\"2025-08-22T03:58:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Tar command in linux allow you to compress files & directories into tar.gz files known as tarballs. Here's how to create tar.gz file in linux.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1\",\"width\":650,\"height\":300,\"caption\":\"how to create tar.gz file in linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-tar-gz-file-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create tar.gz file in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create tar.gz file in Linux - Ubiq BI","description":"Tar command in linux allow you to compress files & directories into tar.gz files known as tarballs. Here's how to create tar.gz file in linux.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Create tar.gz file in Linux - Ubiq BI","og_description":"Tar command in linux allow you to compress files & directories into tar.gz files known as tarballs. Here's how to create tar.gz file in linux.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-10-02T05:00:32+00:00","article_modified_time":"2025-08-22T03:58:32+00:00","og_image":[{"width":650,"height":300,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Create tar.gz file in Linux","datePublished":"2020-10-02T05:00:32+00:00","dateModified":"2025-08-22T03:58:32+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/"},"wordCount":654,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1","keywords":["archive","tarball"],"articleSection":["Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/","name":"How to Create tar.gz file in Linux - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1","datePublished":"2020-10-02T05:00:32+00:00","dateModified":"2025-08-22T03:58:32+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Tar command in linux allow you to compress files & directories into tar.gz files known as tarballs. Here's how to create tar.gz file in linux.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1","width":650,"height":300,"caption":"how to create tar.gz file in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-tar-gz-file-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Create tar.gz file in Linux"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-create-tarball-in-linux.jpg?fit=650%2C300&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-ru","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=1704"}],"version-history":[{"count":22,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1704\/revisions"}],"predecessor-version":[{"id":9244,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1704\/revisions\/9244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/1714"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=1704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=1704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=1704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}