How can I create and extract zip archives from the command line?
|
migrated from stackoverflow.com Jan 28 '11 at 16:37
|
Typically one uses If you are referring specifically to the zip file format, you can simply use the To compress:
To uncompress:
|
|||
|
|
Well, when it comes to distributing files for a variety of operating systems, I'd recommend 7-zip. Usually in the package
Compressing:
Decompressing:
It can also create self-extracting archives with the
I recommend this method in case Windows users can't open 7z archives (in case you want to advice a tool for that: PeaZip). If you want to use the same compression algorithm with your tarballs, use the
7z doesn't create archives with full filesystem information on UNIX, so you'd need to use
|
|||
|
|
|
You can zip files up with:
which will do the current directory. Replace To unzip that file, use:
That's assuming of course that you have a If not, you can just use |
|||
|
|
|
here (for anyone wondering) are the meaning of the flags in his commands c Create a new archive. |
|||||||||
|
and
You'll need to make sure these commands are installed via your package manager. It's no harder than using anything else on the command line. It's certainly simpler than creating archives with tar. |
|||
|
|
|
The most standard answer is Unlike |
|||
|
|