{"id":2050,"date":"2022-12-27T03:45:41","date_gmt":"2022-12-27T03:45:41","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=2050"},"modified":"2023-08-30T09:28:39","modified_gmt":"2023-08-30T09:28:39","slug":"zip-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/zip-command-in-linux\/","title":{"rendered":"The \u201czip \u201d Command in Linux [9 Practical Examples]"},"content":{"rendered":"<p style=\"text-align: justify;\">ZIP is a universally used archive file format that provides lossless data compression. The<strong> zip <\/strong>command line tool in<strong> Linux <\/strong>allows you to create a ZIP archive. In this article, I\u2019ll discuss how you can use the <strong>zip <\/strong>command in <strong>Linux<\/strong> and how many aspects.<\/p>\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 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#A_Description\" >A. Description<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#B_Syntax\" >B. Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#C_Options\" >C. Options<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Installing_the_zip_Command_in_Linux\" >Installing the zip Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Practical_Examples_of_the_%E2%80%9Czip_%E2%80%9D_Command_in_Linux\" >Practical Examples of the \u201czip \u201d Command in Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_1_ZIP_a_File_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\" >Example 1: ZIP a File Using the \u201czip\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_2_ZIP_a_Directory_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\" >Example 2: ZIP a Directory Using the \u201czip\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_3_Remove_Any_File_from_a_ZIP_Archive_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\" >Example 3: Remove Any File from a ZIP Archive Using the \u201czip\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_4_Delete_the_Original_File_After_Zipping\" >Example 4: Delete the Original File After Zipping<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_5_Update_the_File_Inside_a_ZIP_Archive_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\" >Example 5: Update the File Inside a ZIP Archive Using the \u201czip\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_6_ZIP_Excluding_Specified_File\" >Example 6: ZIP Excluding Specified File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_7_Creating_a_Password-Protected_ZIP_File\" >Example 7: Creating a Password-Protected ZIP File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_8_Setting_the_Level_of_Compression_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\" >Example 8: Setting the Level of Compression Using the \u201czip\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Example_9_Split_the_Large_ZIP_File_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\" >Example 9: Split the Large ZIP File Using the \u201czip\u201d Command in Linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"A_Description\"><\/span>A. Description<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>zip<\/strong> command is a simple command that helps compress the file size to save disk space. Compressed files are easier to transfer and less time-consuming.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"B_Syntax\"><\/span>B. Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>syntax<\/strong> for the<strong> zip <\/strong>command is quite plain. You just have to type the command <strong>zip<\/strong> then the archive file along with the file name you want to ZIP. You can use<strong> zip<\/strong> as an extension for the archive file. Otherwise, it is added automatically if the name does not end with a dot <strong>(.)<\/strong>.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip [OPTIONS] File.zip File_List<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<strong>Note:<\/strong> You can zip multiple files at once. Just give the file names you want to zip by keeping space between them. The zip command keeps one or more compressed files in a single zip archive keeping file information (name, date, time, path, modification time) intact.<br \/>\n<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"C_Options\"><\/span>C. Options<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">There are several <strong>options<\/strong> for the <strong>zip<\/strong> command. I will list some of the most useful ones with examples here. You can check the <strong>man<\/strong> page to read more about them.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">man zip<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>Useful Options<\/strong><\/span><\/p>\n<div class=\"su-list\" style=\"margin-left:20px\">\n<ul>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> \u00a0<strong>-r<\/strong> ( to zip a directory)<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-d<\/strong> ( to remove specified files without unzipping)<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-m<\/strong> (to delete the original file after zipping)<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-x<\/strong> (to exclude specified files from zipping)<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-e<\/strong> ( to create a password-protected zip archive)<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-s<\/strong> (to split a large zip file into parts)<\/li>\n<\/ul>\n<\/div>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p><strong>Note:<\/strong> The options in <strong>Linux CLI (Command Line Interface)<\/strong> are all <strong>case-sensitive<\/strong>, So be cautious while using them.<br \/>\n<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Installing_the_zip_Command_in_Linux\"><\/span>Installing the zip Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Most of the versions of <strong>Linux<\/strong> have the <strong>zip<\/strong> command already installed. You can find out whether you have it on your machine or not by typing the command <strong>zip <\/strong>itself.<\/p>\n<p>It will print out the following message if you have it installed already,<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-2061\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1.png\" alt=\"zip command is installed in your ubuntu.\" width=\"626\" height=\"345\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1.png 626w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-300x165.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-1024x564.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-768x423.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-1536x847.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-2048x1129.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-272x150.png 272w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-100x55.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-635x350.png 635w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-1-788x434.png 788w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/> Otherwise, you will get the following text:<img decoding=\"async\" class=\"aligncenter size-full wp-image-2062\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2.png\" alt=\"zip command in linux.\" width=\"700\" height=\"58\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-300x25.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-1024x85.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-760x63.png 760w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-1536x127.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-2048x170.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-1810x150.png 1810w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-100x8.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-2-788x65.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/> In this case, don\u2019t worry. You can install the <strong>zip<\/strong> package within a minute by following the instructions below:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a\u00a0 At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b\u00a0 Type the following in your command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo apt-get install zip<\/code><\/pre>\n<p>\u278c Type your<strong> password<\/strong>.<\/p>\n<p>\u278d Now, press <strong>ENTER<\/strong>.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>After completing these four steps, the zip command will be installed on your system.<img decoding=\"async\" class=\"aligncenter size-full wp-image-2063\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3.png\" alt=\"To install zip command in your ubuntu.\" width=\"700\" height=\"245\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-300x105.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-1024x358.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-766x268.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-1536x538.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-2048x717.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-429x150.png 429w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-100x35.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-1000x350.png 1000w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-3-788x275.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Practical_Examples_of_the_%E2%80%9Czip_%E2%80%9D_Command_in_Linux\"><\/span>Practical Examples of the \u201czip \u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><strong>zip <\/strong>command is a very useful and easy command to use. Whenever you need to shrink your data &amp; free space in your storage you can use it. Below I am giving a list of practical examples where you can see how to use the command in different aspects.<\/p>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Example_1_ZIP_a_File_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\"><\/span>Example 1: ZIP a File Using the \u201czip\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To zip any file you just type the<strong> zip<\/strong> command &amp; then give the archive file name you want to keep your zipped data in. Then add the file list name you want to zip. In this example, I will zip <strong>myfile.txt<\/strong> file. To do so you can follow the below process:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip myfile.zip file.txt<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>The below image shows that the command has created my ZIP archive. Using the <strong>ls<\/strong> command I can see the list of my files and <strong>myfile.zip.<\/strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2064\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4.png\" alt=\"zip command in linux to zip a file.\" width=\"700\" height=\"96\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-300x41.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-1024x140.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-766x105.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-1536x211.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-2048x281.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-1094x150.png 1094w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-100x14.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-4-788x108.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_2_ZIP_a_Directory_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\"><\/span>Example 2: ZIP a Directory Using the \u201czip\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can zip a directory including all the files recursively. To ZIP a directory &amp; every file that exists inside use the zip command with the<strong> -r<\/strong> option. In this example, I will zip the<strong> directory<\/strong>. To do so you can follow the below process:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -r dir.zip directory<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">The output shows that the command has created my ZIP archive. This is quite interesting to see how the <strong>zip<\/strong> command with <strong>option -r<\/strong> is zipping all the files inside my <strong>directory<\/strong> one by one <strong>recursively<\/strong> and then destining them to my<strong> zip archive<\/strong> dir.zip. Using the <strong>ls<\/strong> command I can see the list of my files and the newly made <strong>dir.zip<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2065\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5.png\" alt=\"zip command in linux to zip a directory.\" width=\"700\" height=\"188\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-300x81.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-1024x275.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-767x206.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-1536x413.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-2048x550.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-559x150.png 559w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-100x27.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-1303x350.png 1303w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-5-788x211.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_3_Remove_Any_File_from_a_ZIP_Archive_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\"><\/span>Example 3: Remove Any File from a ZIP Archive Using the \u201czip\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Suppose, you have zipped a directory including many<strong> zip<\/strong> files. Now you want to remove a particular file from that archive without unzipping it. In that case, you can use the <strong>option -d<\/strong> with the<strong> zip<\/strong> command. Write the<strong> zip <\/strong>command with <strong>option -d<\/strong>\u00a0 and then the archive.zip file name you want to remove the file from followed by the file name you want to remove. The <strong>syntax<\/strong> for this is given below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -d filename.zip file.txt<\/code><\/pre>\n<p>In this example, I will remove file A from the zip archive file.zip. To do so you can follow the below process:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">Zip files.zip A B C D E<\/code><\/pre>\n<p>\u278c Press the <strong>ENTER<\/strong> button.<\/p>\n<p>This will create a ZIP archive containing zip files A, B, C, D, and E.<\/p>\n<p>\u278d Now, Type the following command in the command prompt to remove A from the zip archive:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -d files.zip A<\/code><\/pre>\n<p>\u278e Finally, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">In the below picture, you can see I created a <strong>ZIP archive<\/strong> containing zip files <strong>A, B, C, D,<\/strong> and<strong> E<\/strong>. Then I used the <strong>-d<\/strong> option to remove a certain file named <strong>A<\/strong> from the ZIP archive without even unzipping it.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2066\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6.png\" alt=\"Removing a file from zip archive using option -d with zip command in linux.\" width=\"700\" height=\"125\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-300x54.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-1024x183.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-767x137.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-1536x274.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-2048x366.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-840x150.png 840w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-100x18.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-1960x350.png 1960w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-6-788x140.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_4_Delete_the_Original_File_After_Zipping\"><\/span>Example 4: Delete the Original File After Zipping<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can ZIP a file and delete the original file after that. The original file will be deleted after zipping has been completed successfully without any error. When you are zipping files inside a directory and after the removal it becomes empty, also gets removed. To perform you have to use the <strong>-m option<\/strong> with the <strong>zip<\/strong> command.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -m filename.zip file.txt<\/code><\/pre>\n<p>In this example, I will zip <strong>F1<\/strong> and <strong>F2<\/strong> files using <strong>-m<\/strong> as an <strong>option <\/strong>with the <strong>zip<\/strong> command. You can follow these steps.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Now, select the files you want to remove by zipping. Here I am showing you files I will zip by using the below command.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">ls-l<\/code><\/pre>\n<pre><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2067\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7.png\" alt=\"Viewing files using the ls -l command.\" width=\"700\" height=\"230\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-300x99.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-1024x336.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-767x252.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-1536x505.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-2048x673.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-457x150.png 457w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-100x33.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-1065x350.png 1065w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-7-788x258.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>\u278c Now, type the following command in the command prompt:<\/pre>\n<pre><code class=\"language-bash\" data-line=\"\">zip -m files.zip F1 F2<\/code><\/pre>\n<p>\u278d Finally, press the <strong>ENTER<\/strong> button.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2068\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8.png\" alt=\"Delete original file after zipping, using zip command with option -m.\" width=\"700\" height=\"51\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-300x22.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-1024x75.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-755x55.png 755w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-1536x112.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-2048x149.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-100x7.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-8-788x57.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">After the command has been run, we can now see a zip file named <strong>files.zip<\/strong>. And files named <strong>F1<\/strong> &amp; <strong>F2<\/strong> have been removed. Using the <strong>ls -l<\/strong> command we can check.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2069\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9.png\" alt=\"A zip file is being previewed by the ls -l command.\" width=\"696\" height=\"220\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9.png 696w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-300x95.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-1024x324.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-766x242.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-1536x486.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-2048x647.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-475x150.png 475w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-100x32.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-1107x350.png 1107w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-9-788x249.png 788w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_5_Update_the_File_Inside_a_ZIP_Archive_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\"><\/span>Example 5: Update the File Inside a ZIP Archive Using the \u201czip\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can update the file in the ZIP archive. Use<strong> option -u<\/strong> with the<strong> zip<\/strong> command. This <strong>option <\/strong>can be used both to update or to add new files to the zip archive. It will update an existing file in the archive only if it has been modified recently. I will discuss an example where you can see a new file <strong>F3<\/strong> has been added. The syntax is<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -u filename.zip file.txt<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Now type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -u files.zip files.zip F3<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p>From the output, you will see your machine is adding the <strong>F3<\/strong> file to the existing <strong>file.zip<\/strong> archive.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2070\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10.png\" alt=\"Adding a new file to zip archive using zip command with option -u in linux.\" width=\"700\" height=\"31\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-300x13.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-1024x45.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-768x34.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-1536x68.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-2048x91.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-100x4.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-10-788x34.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_6_ZIP_Excluding_Specified_File\"><\/span>Example 6: ZIP Excluding Specified File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In any case, when you want to zip some files from a directory &amp; leave some of them unzipped. Use the <strong>-x<\/strong> option with the zip command. The syntax is:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -x file.zip file_to_be_excluded<\/code><\/pre>\n<p>To check with an example, follow the below steps.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Now, select the directory you want to zip files from. Here, using the <strong>ls<\/strong> command I am showing you a list of files inside my selected directory.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2071\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11.png\" alt=\"Using the ls command to view files inside a directory.\" width=\"700\" height=\"31\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-300x13.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-1024x45.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-768x34.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-1536x68.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-2048x91.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-100x4.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-11-788x34.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>\u278c Then, type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -r NEW.ZIP new directory\/ -x new directory\/5<\/code><\/pre>\n<p style=\"text-align: justify;\">Here, the<strong> zip -r NEW.ZIP new directory<\/strong> part will zip my new directory to <strong>NEW.ZIP<\/strong> archive, and then<strong> -x new directory\/5<\/strong> will exclude <strong>file 5<\/strong> of the new directory from zipping.<\/p>\n<p>\u278d Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">From the output image, we can see zip is compressing and adding all<strong> files (1,2, 3, 4)<\/strong> except <strong>file 5<\/strong> to the <strong>NEW.ZIP<\/strong> archive.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2072\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12.png\" alt=\"zip excluding specified files using -x option with the zip command in linux.\" width=\"700\" height=\"96\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-300x41.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-1024x140.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-766x105.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-1536x211.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-2048x281.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-1094x150.png 1094w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-100x14.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-12-788x108.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_7_Creating_a_Password-Protected_ZIP_File\"><\/span>Example 7: Creating a Password-Protected ZIP File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can zip a file by making it <strong>password-protected.<\/strong> Let&#8217;s assume, you have a private file that you want to zip and transfer. But you don&#8217;t want the wrong person to open it. You can add a <strong>password<\/strong> to open using the<strong> -e <\/strong>option with the <strong>zip<\/strong> command. The syntax is:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -e file.zip file_name<\/code><\/pre>\n<p>I will show you an example, where I will zip my <strong>Pictures<\/strong> folder by adding a password.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Then, type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -e Pictures.zip Pictures<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p>\u278d Enter password.<\/p>\n<p>\u278e Verify your password.<\/p>\n<p>\u278f Finally, press the <strong>ENTER<\/strong> button again.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">Now, the <strong>password-protected<\/strong> zip file has been created. Whenever anyone wants to open this file they have to provide the password to view it.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2073\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13.png\" alt=\"Use option -e with zip command to create password-protected zip file.\" width=\"700\" height=\"62\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-300x27.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-1024x91.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-768x68.png 768w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-1536x136.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-2048x181.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-1694x150.png 1694w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-100x9.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-13-788x69.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_8_Setting_the_Level_of_Compression_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\"><\/span>Example 8: Setting the Level of Compression Using the \u201czip\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The<strong> zip<\/strong> command uses a compression value. By default, it is <strong>6<\/strong> from the range of <strong>0-9<\/strong>. Where <strong>\u20180\u2019<\/strong> is used for uncompressed and <strong>\u20189\u2019<\/strong> for the maximum allowable compression level. We can simply add a number as an<strong> argument <\/strong>with the<strong> zip<\/strong> command to change the level of compression. The syntax is:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -n file.zip file_name<\/code><\/pre>\n<p>Where<strong> n<\/strong> is the compression range\u00a0 <strong>(0-9).<\/strong><\/p>\n<p>I will show you how to do it using an example.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Choose a file and view its size using the below command.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">ls -l<\/code><\/pre>\n<p style=\"text-align: justify;\">After zipping using compression levels <strong>9<\/strong> &amp; <strong>0<\/strong>, keep the zip files in two different archives. That way you can compare the size of those two files after zipping. I will use a file named <strong>new_story<\/strong> on my desktop.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2074\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14.png\" alt=\"ls -l command to view lists of files in current directory.\" width=\"700\" height=\"233\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-300x100.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-1024x341.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-766x255.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-1536x511.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-2048x682.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-451x150.png 451w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-100x33.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-1052x350.png 1052w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-14-788x262.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>\u278c Now, enter the following command in the command prompt: (<strong>for max compression level<\/strong>)<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -9 max_zip new_story<\/code><\/pre>\n<p>\u2779 Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p>\u277a Then, enter another command in the command prompt: <strong>(for the least compression level<\/strong>).<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -0 min_zip new_story<\/code><\/pre>\n<p>\u277b Now again, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #800080;\"><strong>Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">You will see the below image in the output prompt. For<strong> max compression<\/strong>, the zip command is deflating the file. And for the<strong> least compression<\/strong> level, it only stores the data in the zip archive without zipping.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2075\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15.png\" alt=\"selecting the level of compression by giving level number as an optionwith zip command in linux.\" width=\"700\" height=\"60\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-300x26.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-1024x88.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-758x65.png 758w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-1536x132.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-2048x176.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-1750x150.png 1750w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-100x9.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-15-788x67.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/> Using the<strong> ls -l <\/strong>command you can compare the sizes of these two files. You can see the <strong>min_zip<\/strong> file is larger than the <strong>max_zip<\/strong> file. As <strong>max_zip<\/strong> file is compressed in maximum compression level.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2076\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16.png\" alt=\"size comparison between files using ls -l command.\" width=\"700\" height=\"263\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-300x113.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-1024x385.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-767x288.png 767w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-1536x577.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-2048x769.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-399x150.png 399w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-100x38.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-932x350.png 932w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-16-788x296.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_9_Split_the_Large_ZIP_File_Using_the_%E2%80%9Czip%E2%80%9D_Command_in_Linux\"><\/span>Example 9: Split the Large ZIP File Using the \u201czip\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Sometimes you have a too-large file to send or upload as an attachment due to size restrictions. In that case, you can <strong>split <\/strong>your zip file into smaller files using the<strong> -s <\/strong>option with the<strong> zip<\/strong> command<strong>. <\/strong>This way it gets easier to transfer files. You can specify the size you want to split your zip files into. The syntax will be:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -s &lt;size&gt; file.zip file_name<\/code><\/pre>\n<p>In this example, I will split <strong>my google.deb <\/strong>file. To do so you can follow the below processes:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type<strong> ls -l<\/strong> command to list all your files by size. From the picture, you can see I sorted my file size in ascending order using the<strong> sort<\/strong> command with the <strong>ls -l<\/strong> command. You don\u2019t need to sort when you already know your desired file to split. I will split my biggest size file <strong>google.deb.<\/strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2077\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17.png\" alt=\"Selecting file to zip using ls -l command.\" width=\"700\" height=\"246\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-300x105.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-1024x360.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-765x269.png 765w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-1536x540.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-2048x720.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-427x150.png 427w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-100x35.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-996x350.png 996w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-17-788x276.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>\u278c Now, type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">zip -s 20m new.zip google.deb<\/code><\/pre>\n<p>You can see I used<strong> 20m<\/strong> as size cause I want to split my file into <strong>20 megabyte-sized parts<\/strong>. You can use k <strong>(kilobytes<\/strong>), m (<strong>megabytes<\/strong>), g (<strong>gigabytes<\/strong>), or t <strong>(terabytes<\/strong>).<\/p>\n<p>\u278d Finally, press the <strong>ENTER<\/strong> button.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2078\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18.png\" alt=\"spliting large zip file using -s option with zip command in linux.\" width=\"700\" height=\"36\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-300x15.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-1024x53.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-758x39.png 758w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-1536x79.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-2048x105.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-100x5.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-18-788x40.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><span style=\"color: #800080;\"><strong> Output &gt;<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">Using the <strong>ls -l<\/strong> command I can see the list of my files. From where we can see that the command has created<strong> 4<\/strong> new split files. Also, we have our zip file as a whole named <strong>new.zip<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2079\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19.png\" alt=\"List of split &amp; whole zip files, shown using ls -l command.\" width=\"700\" height=\"243\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-300x104.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-1024x355.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-766x266.png 766w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-1536x533.png 1536w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-2048x711.png 2048w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-432x150.png 432w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-100x35.png 100w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-1008x350.png 1008w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux-19-788x273.png 788w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In this article, I described the <strong>zip<\/strong> command &amp; how you can use it with different options to make it more functional. If you go through all the examples I have discussed here, you will surely learn and be a power user.<\/p>\n<hr \/>\n<p><strong><span style=\"font-size: 18pt; color: #000080;\"><a style=\"color: #000080;\" href=\"https:\/\/linuxsimply.com\/wp-admin\/edit.php?post_type=post&amp;author=314897\">Similar Readings<\/a><\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/unzip-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cunzip\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bzip2-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cbzip2\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/gzip-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cgzip\u201d Command in Linux [9 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/gunzip-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cgunzip\u201d Command in Linux [9 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;2050&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;The \u201czip \u201d Command in Linux [9 Practical Examples]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>ZIP is a universally used archive file format that provides lossless data compression. The zip command line tool in Linux &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"The \u201czip \u201d Command in Linux [9 Practical Examples]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/#more-2050\" aria-label=\"Read more about The \u201czip \u201d Command in Linux [9 Practical Examples]\">Read more<\/a><\/p>\n","protected":false},"author":314897,"featured_media":2131,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[56],"class_list":["post-2050","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands","tag-file-compression-commands","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The \u201czip \u201d Command in Linux [9 Practical Examples]<\/title>\n<meta name=\"description\" content=\"The zip command in Linux is used for zipping files. We can modify &amp; enhance the usage of the command using different options with it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The \u201czip \u201d Command in Linux [9 Practical Examples]\" \/>\n<meta property=\"og:description\" content=\"The zip command in Linux is used for zipping files. We can modify &amp; enhance the usage of the command using different options with it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/zip-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/moniramunny05\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-27T03:45:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-30T09:28:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Monira Akter Munny\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monira Akter Munny\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/\"},\"author\":{\"name\":\"Monira Akter Munny\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\"},\"headline\":\"The \u201czip \u201d Command in Linux [9 Practical Examples]\",\"datePublished\":\"2022-12-27T03:45:41+00:00\",\"dateModified\":\"2023-08-30T09:28:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/\"},\"wordCount\":2103,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/zip-command-in-linux.png\",\"keywords\":[\"file compression commands\"],\"articleSection\":[\"Linux Commands\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/\",\"name\":\"The \u201czip \u201d Command in Linux [9 Practical Examples]\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/zip-command-in-linux.png\",\"datePublished\":\"2022-12-27T03:45:41+00:00\",\"dateModified\":\"2023-08-30T09:28:39+00:00\",\"description\":\"The zip command in Linux is used for zipping files. We can modify & enhance the usage of the command using different options with it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/zip-command-in-linux.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/zip-command-in-linux.png\",\"width\":400,\"height\":400,\"caption\":\"zip command in linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/zip-command-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The \u201czip \u201d Command in Linux [9 Practical Examples]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\",\"name\":\"Monira Akter Munny\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"caption\":\"Monira Akter Munny\"},\"description\":\"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/moniramunny05\",\"https:\\\/\\\/www.instagram.com\\\/monira_munny\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/monira-akter-munny-a76742113\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/munny\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The \u201czip \u201d Command in Linux [9 Practical Examples]","description":"The zip command in Linux is used for zipping files. We can modify & enhance the usage of the command using different options with it.","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:\/\/linuxsimply.com\/zip-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"The \u201czip \u201d Command in Linux [9 Practical Examples]","og_description":"The zip command in Linux is used for zipping files. We can modify & enhance the usage of the command using different options with it.","og_url":"https:\/\/linuxsimply.com\/zip-command-in-linux\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/moniramunny05","article_published_time":"2022-12-27T03:45:41+00:00","article_modified_time":"2023-08-30T09:28:39+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux.png","type":"image\/png"}],"author":"Monira Akter Munny","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Monira Akter Munny","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/"},"author":{"name":"Monira Akter Munny","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e"},"headline":"The \u201czip \u201d Command in Linux [9 Practical Examples]","datePublished":"2022-12-27T03:45:41+00:00","dateModified":"2023-08-30T09:28:39+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/"},"wordCount":2103,"commentCount":1,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux.png","keywords":["file compression commands"],"articleSection":["Linux Commands"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/zip-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/","url":"https:\/\/linuxsimply.com\/zip-command-in-linux\/","name":"The \u201czip \u201d Command in Linux [9 Practical Examples]","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux.png","datePublished":"2022-12-27T03:45:41+00:00","dateModified":"2023-08-30T09:28:39+00:00","description":"The zip command in Linux is used for zipping files. We can modify & enhance the usage of the command using different options with it.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/zip-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2022\/12\/zip-command-in-linux.png","width":400,"height":400,"caption":"zip command in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/zip-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"The \u201czip \u201d Command in Linux [9 Practical Examples]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e","name":"Monira Akter Munny","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","caption":"Monira Akter Munny"},"description":"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio","sameAs":["https:\/\/www.facebook.com\/moniramunny05","https:\/\/www.instagram.com\/monira_munny\/","https:\/\/www.linkedin.com\/in\/monira-akter-munny-a76742113\/"],"url":"https:\/\/linuxsimply.com\/author\/munny\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/2050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314897"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=2050"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/2050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/2131"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=2050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=2050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=2050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}