在 Linux/Ubuntu 中根据文件大小压缩多个文件夹和文件
我有一个目录“mapnik”,其中有数百个子目录,每个子目录包含超过 10000 个文件。我想递归地压缩“mapnik”,保留文件夹结构,但仅将大于 103 字节的文件添加到存档中。
我怎样才能做到这一点?我尝试使用查找和管道,但由于语法错误和文件数量巨大,“反复试验”并不是完成它的最佳方法;)
感谢你们的帮助!
I have a directory "mapnik" with hundreds of sub-directories, each containing more than 10000 files. I would like to zip "mapnik" recursively, preserving the folder-structure but only adding files greater than 103 Byte to the archive.
How can I accomplish this? I tried using find and pipes, but with the wrong syntax and the huge number of files, "trial and error" is not the best way to get it done ;)
Thanks for your help guys!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
怎么样
How about
Delan 的建议产生了某种同名文件的压缩错误。但这让我走上了正轨。这对我有用:
Delan's suggestion produced some kind of zip-error whith files of the same name. But it got me on the right track. This is what worked for me: