LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1201|回复: 6

请问如何用shell打包大量文件?非常谢谢。。

[复制链接]
发表于 2006-3-31 17:58:30 | 显示全部楼层 |阅读模式
文件夹内有十万文件,直接用zip打包发现只有几千文件加入了压缩包。

我比较菜。请清楚点给出具体命令。非常谢谢。。
发表于 2006-3-31 18:01:37 | 显示全部楼层
zip -r 归档文件名 要归档的目录

具体情况你没说清楚。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-31 20:02:58 | 显示全部楼层
Post by seamonkey
zip -r 归档文件名 要归档的目录

具体情况你没说清楚。



非常感谢您的回复。。

具体情况是这样子的。

因为文件数量太多,所以无法全部打包近来,对一个具有十万文件的目录用zip -r 以后发现只7前多文件进了压缩包。。

我想是不是类似删除大量文件那样子,文件太多要在xargs才能删除掉 。

具体命令怎么写呢?
回复 支持 反对

使用道具 举报

发表于 2006-3-31 20:11:26 | 显示全部楼层
是不是程序本身的限制

http://www.info-zip.org/FAQ.html#limits
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-31 20:16:04 | 显示全部楼层
果然。

number of files         65,536


那我现在该怎么办呢?
回复 支持 反对

使用道具 举报

发表于 2006-3-31 20:51:59 | 显示全部楼层
tar呢,tar有整个归档文件大小的限制,但不知道是否有归档中文件数的限制。

rar的限制:

What is the maximum number of files that can be added to an archive?


The number of files, which can be added to an archive, depends upon the amount of available memory and the length of the file names. Roughly 128 bytes of memory are required per archived file for a RAR archive. For example, it is recommended to have 128 MB if you are going to archive millions of files. WinRAR has been tested to handle over 10 million files.
回复 支持 反对

使用道具 举报

发表于 2006-4-1 01:06:40 | 显示全部楼层
I think you can always try to split them to several folders to tar/zip them.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表