OpenVMS
1753930 會員
9883 線上
108810 解決方案
發表新文章

如何用zip壓縮多個檔案?

 
watermelonyu
教授

如何用zip壓縮多個檔案?

已看了很多網站,也沒提及如何用zip壓縮多個檔案...

$zip archive_name file_spec

如我要在windows 存取這zip檔, 是否要加 -9kl, /VMS/ ?

另外,如要壓縮一個directory 和 其檔案,又是用什麼command?

keep allfiles*.*;* 這command也用不了..

P.S.我用的是zip 2.3
2則回覆 2
watermelonyu
教授

如何用zip壓縮多個檔案?

-您提及的 -9kl, keep allfiles*.*;* 應該不是 zip 2.3 (Info-ZIP 2.3) 的語法! 請試試 $zip -h



-如果壓縮後的檔案是要給其他 VMS 系統用的, 用 "-V" options (i.e. $zip "-V" arvhive_name file_spec )



-如果壓縮後的檔案是要給 Windows or Unix 用的, 一般不需再加 options.

如果 VMS 的檔案 Record format: 是 Stream or Stream-LF, 則可能會用到 options "-l" (convert LF to CR LF)

或 "-ll" (convert CR LF to LF). 這要看在 Windows or Unix 上使用的是哪一種 tools (e.g. notepad or Wordpad...)



-Examples:



$ dir



Directory DRA0:



a.txt;1 B.txt;1 c.txt;1

test1.DIR;1 test2.DIR;1 testXX.DIR;1



Total of 6 files.





$ zip text.zip *.txt

adding: A.TXT (deflated 57%)

adding: B.TXT (deflated 57%)

adding: C.TXT (deflated 57%)

$

$ zip some_text.zip a.txt c.txt

adding: A.TXT (deflated 57%)

adding: C.TXT (deflated 57%)

$

$ zip dir.zip *.*;*

adding: T1.DAT (stored 57%)

adding: T2.DAT (stored 57%)

$

$ set def

$ dir



Directory DRA0:



xxx.DIR;1



Total of 1 file.

$

$ zip xxx_dir.zip *.*;*

adding: A.TXT (deflated 57%)

adding: B.TXT (deflated 57%)

adding: C.TXT (deflated 57%)

adding: DIR.ZIP (stored 0%)

adding: SOME_TEXT.ZIP (stored 0%)

adding: (stored 0%)

adding: (stored 0%)

adding: (stored 0%)

adding: TEXT.ZIP (stored 0%)

adding: T1.DAT (stored 57%)

adding: T2.DAT (stored 57%)

adding: TXX.TXT (deflated 57%)

$
watermelonyu
教授

如何用zip壓縮多個檔案?

大致上都明白了,謝謝



$ set def

這一句是什麼意思?



若有一堆檔案,檔名裡有數字, 而那些數字是連續的, 我想把其中一些連著號碼的檔案壓做一個zip file, 可以怎樣幹?

e.g. 壓doc001.dat到doc999.dat 裡的 doc560.dat 到 doc620.dat