Code Ghar

Zip Files in Ubuntu CLI

Posted in configuration by hs on December 8, 2007

If you want to work with zip files in Ubuntu command line interface, you will need these commands: zip and unzip.

Zip

To install zip if you don’t already have it, do this

sudo apt-get install zip

The simplest way to create a zip file (archive) is

zip myzipfile.zip file1 file2 file3 ...

Where myzipfile.zip is the file (zip archive) you are creating and file1, file2, file3, and so on, are the files you are including in that archive. So let’s say you need to create a zip file of your resumé which is in different file formats, you would something like

zip myresume.zip resume.odt resume.pdf resume.doc resume.txt

Unzip

To unzip files, you need to have a command called unzip. To install unzip if you don’t already have it, do this

sudo apt-get install unzip

The simplest way to extract all files from a zip archive is

unzip myzipfile.zip

Where myzipfile.zip is the file (zip archive) you are unzipping. So let’s say you need to extract (unzip) a zip file of your resumé which contains different files, you would something like

unzip myresume.zip

Tagged with: ,

6 Responses

Subscribe to comments with RSS.

  1. [...] would be unzip for downloads (only tar is available at this point): sudo aptitude install unzip (http://codeghar.wordpress.com/2007/12/08/zip-files-in-ubuntu-cli/ [...]

  2. [...] would be unzip for downloads (only tar is available at this point): sudo aptitude install unzip (http://codeghar.wordpress.com/2007/12/08/zip-files-in-ubuntu-cli/ [...]

  3. -a- said, on January 4, 2009 at 9:14 am

    I was staggered that the minimal ubuntu installation did not include zip and unzip. Is there another command-line program that can handle this file type?

  4. rishu said, on September 18, 2009 at 4:16 pm

    thanks a lot dude………..but is there some other way for this zip thingy…………a bit of easy……….

  5. [...] Zip Files in Ubuntu CLI « Code Ghar [...]

  6. [...] Zip Files in Ubuntu CLI « Code Ghar [...]


Leave a Reply