This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9468|Reply: 0

[linux] Centos zip and unzip commands

[Copy link]
Posted on 12/27/2014 2:11:32 PM | | |

When backing up data with ftp software, it takes a lot of time due to too many files, so you need to use compression and decompression commands, for example, I need to back up the /opt/data folder, but because there are tens of thousands of files in the data, you need to use the zip command at this time, see the data file compressed and then transferred:

cd /opt

zip -r data.zip data

OK, the data file is compressed into data.zip format, which is very fast to upload and download. In the same way, when transferring a compressed file to CentOS, you can use unzip to unzip the file; For example, if you unzip /opt/data.zip, you can use the following command:

cd /opt

unzip data.zip

===============================

There are many more related commands as follows:

1. I want to compress a file abc.txt and a directory dir1 into yasuo.zip:

# zip -r yasuo.zip abc.txt dir1

2. I downloaded a yasuo.zip file and want to unzip it:

# unzip yasuo.zip

3. I have abc1.zip, abc2.zip and abc3.zip in my current directory, and I want to unzip them together:

# unzip abc\?. zip

Note: Indicates one character, if * represents any number of characters.

4. I have a large zip file large.zip and I don't want to unzip it, just want to see what's in it:

# unzip -v large.zip

5. I downloaded a compressed file large.zip want to verify whether the compressed file is fully downloaded

# unzip -t large.zip

6. I used the -v option to find that there are many directories and subdirectories in music.zip compressed file, and the subdirectories are actually song mp3 files, I want to download these files to the first-level directory, instead of building a directory layer by layer:

# unzip -j music.zip




Previous:Circumvention software sharing
Next:I just bought an iPad Air 2 and it feels okay
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com