赞
踩




-P - 使用 zip 的密码选项unzip -P 123456 runtime_lib.zip
strong@foreverstrong:~/demo_workspace/yongqiang$ ls -l
total 173696
-rw-rw-r-- 1 strong strong 177857059 Aug 30 20:55 runtime_lib.zip
strong@foreverstrong:~/demo_workspace/yongqiang$
strong@foreverstrong:~/demo_workspace/yongqiang$ unzip -P 123456 runtime_lib.zip
Archive: runtime_lib.zip
creating: runtime_lib/
inflating: runtime_lib/libcublas.so.8.0
inflating: runtime_lib/libcudart.so.8.0
inflating: runtime_lib/libcudnn.so.6
inflating: runtime_lib/libcurand.so.8.0
strong@foreverstrong:~/demo_workspace/yongqiang$
zip -r -P 123456 ./runtime_lib.zip ./runtime_lib
unzip -P 123456 runtime_lib.zip
-r 递归处理,将指定目录下的所有文件和子目录一并处理。
strong@foreverstrong:~/demo_workspace/yongqiang$ ll
total 12
drwxrwxr-x 3 strong strong 4096 Aug 30 21:12 ./
drwxrwxr-x 24 strong strong 4096 Aug 30 20:52 ../
drwxrwxr-x 2 strong strong 4096 Apr 18 19:37 runtime_lib/
strong@foreverstrong:~/demo_workspace/yongqiang$
strong@foreverstrong:~/demo_workspace/yongqiang$ zip -r -P 123456 ./runtime_lib.zip ./runtime_lib
adding: runtime_lib/ (stored 0%)
adding: runtime_lib/libcurand.so.8.0 (deflated 26%)
adding: runtime_lib/libcudnn.so.6 (deflated 31%)
adding: runtime_lib/libcublas.so.8.0 (deflated 36%)
adding: runtime_lib/libcudart.so.8.0 (deflated 71%)
strong@foreverstrong:~/demo_workspace/yongqiang$
strong@foreverstrong:~/demo_workspace/yongqiang$ ll
total 173704
drwxrwxr-x 3 strong strong 4096 Aug 30 21:13 ./
drwxrwxr-x 24 strong strong 4096 Aug 30 20:52 ../
drwxrwxr-x 2 strong strong 4096 Apr 18 19:37 runtime_lib/
-rw-rw-r-- 1 strong strong 177857059 Aug 30 21:13 runtime_lib.zip
strong@foreverstrong:~/demo_workspace/yongqiang$
strong@foreverstrong:~/demo_workspace/yongqiang$ unzip runtime_lib.zip
Archive: runtime_lib.zip
creating: runtime_lib/
[runtime_lib.zip] runtime_lib/libcurand.so.8.0 password:
inflating: runtime_lib/libcurand.so.8.0
inflating: runtime_lib/libcudnn.so.6
inflating: runtime_lib/libcublas.so.8.0
inflating: runtime_lib/libcudart.so.8.0
strong@foreverstrong:~/demo_workspace/yongqiang$
strong@foreverstrong:~/demo_workspace/yongqiang$ ll
total 173704
drwxrwxr-x 3 strong strong 4096 Aug 30 21:13 ./
drwxrwxr-x 24 strong strong 4096 Aug 30 20:52 ../
drwxrwxr-x 2 strong strong 4096 Apr 18 19:37 runtime_lib/
-rw-rw-r-- 1 strong strong 177857059 Aug 30 21:13 runtime_lib.zip
strong@foreverstrong:~/demo_workspace/yongqiang$
strong@foreverstrong:~/demo_workspace/yongqiang$ unzip -P 123456 runtime_lib.zip
Archive: runtime_lib.zip
replace runtime_lib/libcurand.so.8.0? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: runtime_lib/libcurand.so.8.0
replace runtime_lib/libcudnn.so.6? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: runtime_lib/libcudnn.so.6
replace runtime_lib/libcublas.so.8.0? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: runtime_lib/libcublas.so.8.0
replace runtime_lib/libcudart.so.8.0? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: runtime_lib/libcudart.so.8.0
strong@foreverstrong:~/demo_workspace/yongqiang$
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。