{"id":11023,"date":"2021-12-06T12:51:15","date_gmt":"2021-12-06T12:51:15","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=11023"},"modified":"2021-12-06T12:51:16","modified_gmt":"2021-12-06T12:51:16","slug":"zip-files-folders-ubuntu-debian-linux","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/","title":{"rendered":"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal"},"content":{"rendered":"\n

With Zip files being one of the most popular archive file formats, it is one of the most convenient ways to compress multiple files or directories into one file. Working with zip files in Ubuntu<\/a> and Debian is quite simple.<\/p>\n\n\n\n

Zipping or compressing allows the user to save disk space and network bandwidth. Zip is also a compression and file packaging utility for Linux and Unix commands. There is a companion program called unzip that is used to unpack zip archives.<\/p>\n\n\n\n

Prerequisites to Zip Files in Ubuntu<\/h2>\n\n\n\n

Before you can create zip files in Ubuntu or Debian<\/a> and subsequently unpack (unzip) the same archives you need to have the utilities installed in your system.<\/p>\n\n\n\n

Run the following in the command line install zip and unzip support:<\/p>\n\n\n\n

$ sudo apt install zip unzip<\/code><\/pre>\n\n\n\n

The syntax for using the zip command is as follows:<\/p>\n\n\n\n

zip [option] output_file_name input1 [input2]<\/strong><\/p>\n\n\n\n

For example:<\/p>\n\n\n\n

$ zip -r output.zip folder\n$ zip -r output.zip file folder1 folder2\n$ zip -r output.zip \/path\/to\/folder1 \/path\/to\/file2<\/code><\/pre>\n\n\n\n

Zip all files in current directory.<\/p>\n\n\n\n

$ zip -r output.zip<\/code><\/pre>\n\n\n\n

Zip all files in the current directory and subdirectories too.<\/p>\n\n\n\n

$ zip output.zip *<\/code><\/pre>\n\n\n\n

The -r<\/strong> option will recurse into directories and compress its contents as well. The .zip<\/strong> extension in the output files is optional as .zip<\/strong> is added by default.<\/p>\n\n\n\n

Another important option is the -e<\/strong> option which password protects the output zip files. For example:<\/p>\n\n\n\n

$ zip -r -e output.zip \/path\/to\/folder\/<\/code><\/pre>\n\n\n\n

You will then be prompted for the password.<\/p>\n\n\n\n

You can also specify the password as part of the command like so:<\/p>\n\n\n\n

$ zip -r -e -P 'YOUR_PASSWORD' output.zip \/path\/to\/folder\/<\/code><\/pre>\n\n\n\n

Note: The -P ‘YOUR_PASSWORD’ option to the zip is insecure. Many multi-user operating systems such as Linux provide ways for any user to see the current command line of any other user. Having the plaintext password as part of a command-line should always be avoided.<\/em><\/p>\n\n\n\n

You can verify zip files with the ls command:<\/p>\n\n\n\n

$ ls -l output.zip<\/code><\/pre>\n\n\n\n

Conclusion<\/h2>\n\n\n\n

You just learned how to compress a directory into zip files in Ubuntu or Debian Linux using the zip command.<\/p>\n","protected":false},"excerpt":{"rendered":"

With Zip files being one of the most popular archive file formats, it is one of the most convenient ways to compress multiple files or directories into one file. Working…<\/p>\n","protected":false},"author":1,"featured_media":11025,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,16],"tags":[183,193,354,424,433,573,591,598],"yoast_head":"\nHow to Zip Files in Ubuntu \/ Debian Linux Systems Terminal<\/title>\n<meta name=\"description\" content=\"This guide will show you how to zip files and folders in the different flavors of Ubuntu and Debian Linux systems command line terminal\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal\" \/>\n<meta property=\"og:description\" content=\"This guide will show you how to zip files and folders in the different flavors of Ubuntu and Debian Linux systems command line terminal\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-06T12:51:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-06T12:51:16+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal\",\"datePublished\":\"2021-12-06T12:51:15+00:00\",\"dateModified\":\"2021-12-06T12:51:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\"},\"wordCount\":312,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg\",\"keywords\":[\"Debian\",\"DevOps\",\"Linux\",\"Open Source\",\"Optimization\",\"Systems Administration\",\"Tools\",\"Ubuntu\"],\"articleSection\":[\"Articles\",\"Guides\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\",\"url\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\",\"name\":\"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg\",\"datePublished\":\"2021-12-06T12:51:15+00:00\",\"dateModified\":\"2021-12-06T12:51:16+00:00\",\"description\":\"This guide will show you how to zip files and folders in the different flavors of Ubuntu and Debian Linux systems command line terminal\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg\",\"width\":1280,\"height\":680,\"caption\":\"zip files in ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal","description":"This guide will show you how to zip files and folders in the different flavors of Ubuntu and Debian Linux systems command line terminal","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":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal","og_description":"This guide will show you how to zip files and folders in the different flavors of Ubuntu and Debian Linux systems command line terminal","og_url":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2021-12-06T12:51:15+00:00","article_modified_time":"2021-12-06T12:51:16+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal","datePublished":"2021-12-06T12:51:15+00:00","dateModified":"2021-12-06T12:51:16+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/"},"wordCount":312,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg","keywords":["Debian","DevOps","Linux","Open Source","Optimization","Systems Administration","Tools","Ubuntu"],"articleSection":["Articles","Guides","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/","url":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/","name":"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg","datePublished":"2021-12-06T12:51:15+00:00","dateModified":"2021-12-06T12:51:16+00:00","description":"This guide will show you how to zip files and folders in the different flavors of Ubuntu and Debian Linux systems command line terminal","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/zip-files-in-ubuntu.jpg","width":1280,"height":680,"caption":"zip files in ubuntu"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/zip-files-folders-ubuntu-debian-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Zip Files in Ubuntu \/ Debian Linux Systems Terminal"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11023"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=11023"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11023\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/11025"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=11023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=11023"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=11023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}