将大量文件压缩成 n 个 zipfiles

Zip large number of files into n zipfiles

我的文件夹中有大量文件。如何压缩所有文件,以便每个压缩文件有 n 个文件。

我知道您可以使用 --split-size 按大小拆分,但它需要最终压缩包的文件大小。我想指定将包含在单个 zip 中的文件数。

这将从当前目录中获取所有文件并将它们 n 一次(本例中 n=10)保存到 zip 存档中:

find .  -maxdepth 1 -type f -print0 | xargs -0 -n 10 bash -c 'zip $$.zip "$@"' none