备份脚本会经常使用到压缩命令
#把Desktop目录压缩成Desktop.zip文件放到Templates目录下
[centos@bogon ~]$ zip -r ./Templates/Desktop.zip Desktop/
adding: Desktop/ (stored 0%)
adding: Desktop/bak_test_20180704150103.tar.gz (stored 0%)
#进入并查看Templates目录
[centos@bogon ~]$ cd Templates/
[centos@bogon Templates]$ ls
Desktop.zip
#查看Desktop.zip压缩文件是否完整
[centos@bogon Templates]$ unzip -t Desktop.zip
Archive: Desktop.zip
testing: Desktop/ OK
testing: Desktop/bak_test_20180704150103.tar.gz OK
No errors detected in compressed data of Desktop.zip.
#查看Desktop.zip压缩文件内容
[centos@bogon Templates]$ unzip -v Desktop.zip
Archive: Desktop.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
0 Stored 0 0% 07-04-2018 15:01 00000000 Desktop/
866 Stored 866 0% 07-04-2018 15:01 86be0bf0 Desktop/bak_test_20180704150103.tar.gz
--------