[英]How to zip all txt files recursively in linux using zip?
我想在linux
中使用zip
命令遞歸zip
所有.txt
文件。 為此,我正在使用:
zip -r /home/folder/zipName /home/folder2/subfolder1/*.txt
它給了我以下錯誤:
zip warning: missing end signature--probably not a zip file (did you
zip warning: remember to use binary mode when you transferred it?)
zip warning: (if you are trying to read a damaged archive try -F)
zip error: Zip file structure invalid
用
zip -r /home/folder/zipName /home/folder2/subfolder1 -i \*.txt
它會做你所期望的。
這對我有用...
zip -r /home/folder/zipName /home/folder2/subfolder1/**/*.txt
我遇到了同樣的錯誤,我發現解決方案是確保您的zipName
以.zip
結尾。 把它放在這里以防它可以幫助其他人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.