[root@sky9896 /]# zip -rv linux.zip linux/ #打包linux目录下的所有内容
adding: linux/ (in=0) (out=0) (stored 0%)
adding: linux/Ubuntu.txt (in=33) (out=33) (stored 0%)
adding: linux/RedHat.txt (in=0) (out=0) (stored 0%)
adding: linux/CentOS.txt (in=34) (out=34) (stored 0%)
total bytes=67, compressed=67 -> 0% savings
[root@sky9896 linux]# zip -rv linux.zip * -x Ubuntu.txt #打包所有内容,同时排除Unbunt.txt
adding: CentOS.txt (in=34) (out=34) (stored 0%)
adding: RedHat.txt (in=0) (out=0) (stored 0%)
total bytes=34, compressed=34 -> 0% savings
[root@sky9896 linux]# zip linux.zip -d RedHat.txt #删除压缩包中的RedHat.txt
deleting: RedHat.txt
[root@sky9896 linux]# unzip linux.zip -d /data/backup #解压缩
Archive: linux.zip
extracting: /data/backup/CentOS.txt
转载于:https://blog.51cto.com/sky9896/2170656