During website migration, too many files in the website directory will consume a lot of time, so we need to use the compression and decompression commands, such as, I need to back up the/home/wwwroot folder, however, because wwwroot contains tens of thousands or even more files, you need to use the zip command to compress the wwwroot file and then transfer it:
CD/wwwroot
Zip-r wwwroot.zip wwwroot
OK ,the wwwrootfile is compressed into the wwwroot.zip format, which is uploaded and downloaded quickly. Similarly, when uploading a compressed file to centos, You can decompress the file using unzip. For example, to decompress/home/wwwroot.zip, run the following command:
CD/home
Unzip wwwroot.zip
====================================
More related commands are as follows:
1. I want to compress a file abc.txtand a directory dir1into yasuo.zip:
# Zip-r yasuo.zip abc.txt dir1
2. I downloaded a yasuo.zip file and want to decompress it:
# Unzip yasuo.zip
3. I have abc1.zip, abc2.zip, and abc3.zip under the current directory. I want to decompress them together:
# Unzip ABC \?. Zip
Note :? Represents a single character. If "*" is used, it indicates any number of characters.
4. I have a large compressed file large.zip. I don't want to decompress it. I just want to see what it contains:
# Unzip-V large.zip
5. I downloaded a compressed file large.zip and want to verify whether the downloaded file is complete.
# Unzip-T large.zip
6. I used -v8.0 to find that there are many directories and subdirectories in the music.zip compressed file, and the subdirectories are actually MP3 files. I want to download these files to the first-level directory instead of the first-level directory:
# Unzip-J music.zip
Http://liuzhichao.com/p/681.html