添加1.txt
和2.txt
到output.zip
:
1 |
zip ouput.zip 1.txt 2.txt |
如果1.txt
已经存在于压缩包了,希望添加2.txt
到包内,加上-u
选项:
1 2 3 4 |
> zip output.zip 1.txt adding: 1.txt (stored 0%) > zip output.zip -u 2.txt # 更新压缩包 adding: 2.txt (stored 0%) |
递归压缩选项-r
:
1 2 3 4 5 6 7 8 9 |
> rm subdir/ -rf > mkdir dir/subdir -p > echo HelloWorld > dir/subdir/1.txt > echo HelloWorld > dir/2.txt > zip -r output.zip dir/ adding: dir/ (stored 0%) adding: dir/subdir/ (stored 0%) adding: dir/subdir/1.txt (stored 0%) adding: dir/2.txt (stored 0%) |
设置压缩密码加-P
选项:
1 2 |
> zip -P 123456 panda.zip panda.exe adding: panda.exe (deflated 49%) |
评论