Zip Files in Ubuntu CLI

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

About these ads

15 Responses to Zip Files in Ubuntu CLI

  1. Pingback: Installing a LAMP Server on Slicehost (and maybe elsewhere) « A Life of Constant Flux

  2. Pingback: Installing a LAMP Server, with Wordpress, on Slicehost (and maybe elsewhere) « A Life of Constant Flux

  3. -a- says:

    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 says:

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

  5. Pingback: Daily Digest for September 21st | piersonthe.net

  6. Pingback: Daily Digest for September 22nd | piersonthe.net

  7. Thanks,

    This was indeed easy to follow and helpful.

    Cheers

  8. sanjeev says:

    It is very helpful……thank you for your post.

  9. Anonymous says:

    Thx man…:=)) very easy:))!

  10. ermi says:

    even though i used this technique for python code … this saved me a half a day … thank you

  11. Faris says:

    in Windows 7 64-bit
    I am using WinRar to unzip file of format .zip
    it was not a successful unzip.

    when i tried to unzip same file on Ubuntu
    i was successfully able to unzip that file.

    when i tried to move that file to windows7, i got error !

    by the way, the file was compressed on Ubuntu.

    ???

  12. If I use the command to install zip command line tool on the server I get the message that there is no installation package available.
    I need it for a friend of mine and I use only CentOS with Webmin/Virtualmin on all my servers. (On this server is Ubuntu 10.04 with Plesk 10)
    It would be helpful if someone can support me.
    – How can I add an respository to the server that I can install the zip command line tool?
    – Is there another way to add it.

    Thx

  13. Precious says:

    Just Awesome..!!!

  14. how to zip the file with different format (pdf and doc)

  15. dakyan says:

    so helpful..

    thank you..

Follow

Get every new post delivered to your Inbox.

Join 33 other followers

%d bloggers like this: