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 |