• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3627
  • Last Modified:

Create zip file in Ubuntu from command line

How can I create a Zip file in Ubuntu from the command line? I can already create tarballs but can't seem to create zips.
0
TotallyMe
Asked:
TotallyMe
1 Solution
 
torimarCommented:
You'll have to install the zip/unzip commands first:

sudo apt-get install zip && sudo apt-get install unzip

Then you can compress a file with this command:
zip archivename.zip file1 file2 .... fileX
0
 
nbthanhCommented:
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 dont 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 lets 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 dont 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 lets say you need to extract (unzip) a zip file of your resumé which contains different files, you would something like

unzip myresume.zip

You can find more detail here: http://codeghar.wordpress.com/2007/12/08/zip-files-in-ubuntu-cli/
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now