zip and unzip related commands

1. zip compression
basic command:
zip compressed file .zip file to be compressed 1 file to be compressed 2 ...

Compressed folder:
zip -r compress file .zip file to be compressed 1 file to be compressed 2 ...

Volume compression (to prevent some scenarios, such as the sz command does not support large files)
The following example is to compress all files starting with 2016 into data.zip, and the size of each volume is:
zip -r -s 1G data.zip 2016*  

Note that since unzip does not support volume division, , must be merged before unzipping:
zip -s 0 data.zip --out data_in_one.zip


2. Unzip decompression
Basic
unzip compressed file.zip 

Specify the decompressed path:
unzip compressed file.zip -d outputdir/

Directly overwrite existing files:
unzip -o compress the file.zip -d outputdir/

Unzip all the zip files in the current folder to the specified directory:
unzip "*.zip"  -d outputdir/


For more options see:
http://man.linuxde.net/zip
http://man.linuxde.net/unzip

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326429315&siteId=291194637
Recommended