Linux decompression zip format compressed package

Compression and decompression of zip format in Linux

1. Installation

yum install -y unzip

Two, use

(1), compression

Common usages include
compressing 1.txt in the current directory to 1.zip. The option -q means to ignore the execution process, -r means to recursively process, and all files and subdirectories in the specified directory will be processed together

zip -q -r 1.zip 1.txt

Compress 1.txt in the parent directory to 1.zip

zip -q -r 1.zip ../1.txt

(2), decompression

Suppose the current directory has a compressed package as 1.zip

Common usages are

Unzip directly to the current directory

unzip 1.zip

Specify the decompression path by -d, that is, decompress it to the folder folder in the current directory. If this folder does not exist, it can be created automatically

unzip 1.zip -d folder

(3), view the compressed file

List the contents of the compressed file 1.zip

zip -sf 1.zip

Guess you like

Origin blog.csdn.net/mao_mao37/article/details/129791240