Answers:
您甚至不需要解压缩文件,就可以更新现有文件:
zip -u existing.zip file.txt
从zip
手册:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
如果要添加完整的文件夹,请添加-r
。
要更新许多zip文件,请执行以下操作:
for z in *.zip; do
zip -u "$z" file.txt
done