文件压缩:zip

[root@localhost ~]# yum install -y zip unzip    // 安装 zip 和 unzip
[root@localhost ~]# zip 1.zip 1.txt             // 压缩文件,要同时指定压缩后的文件名
[root@localhost ~]# zip -r test.zip test        // 压缩目录,要同时指定压缩后的文件名
[root@localhost ~]# zip 1.zip 1.txt 2.txt       // 表示把 1.txt 和 2.txt 压缩成一个文件 1.txt.zip
[root@localhost ~]# unzip 1.zip                 // 解压缩
原文地址:https://www.cnblogs.com/mingerlcm/p/7784202.html