有没有最快的选项将文件从 dir1 复制到 dir2?
我使用 cp 在 Linux 盒子中复制大量小文件(b/n 1M 和 10M 大小;总共约 6G)。没有计时,但由于我要一次又一次cp,可以计时吗,稍后再具体一点;但由于 cp 不是主要任务,如果有更好的选择/选择/方式,就无法忍受它所花费的时间。因此,如果有更好的方式/选项/方法将文件从一个目录cp-ing(更快)到另一个目录,请很高兴尝试一下。
谢谢,
i used cp to copy lots of small files (b/n 1M and 10M size; around 6G total) in Linux box. Didn't time it but since i am going to do cp again and again, can time it and be more specific later; but since the cp is not the major task, can't tolerate the time it's taking if there is a better option/choice/way. So, if there is a better way/option/method to do cp-ing (faster) files from one dir to another, be glad glad to try it out.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
tar/untar 或 rsync 当被告知不要校验和时会更快,因为它们批量读取文件而不是逐一处理它们。
Either of tar/untar or
rsync
when told not to checksum will be faster, since they bulk-read files instead of handling them one-by-one.您可以尝试 cpio,因为它有一个复制目录到目录模式。
You could try cpio, as that has a copy directory to directory mode.
使用 perl 进行最快的复制:
use perl for fastest copy:
尝试仅备份今天的文件:
来自:
http:// commandperls.com/find-all-today%E2%80%99s-files-and-copy-them-to-another-directory/
Try this just backup today's files:
from:
http://commandperls.com/find-all-today%E2%80%99s-files-and-copy-them-to-another-directory/
您尝试过吗:(
来源:https://lists.debian.org/ debian-user/2001/06/msg00288.html)
Have you tried:
(Credits: https://lists.debian.org/debian-user/2001/06/msg00288.html)
你可以使用焦油。这是我发现的最快的方法。
此命令将 SOURCE_FOLDER 的内容压缩到 tar 存档中,然后将该存档提取到 DESTINATION_FOLDER 中,同时保留目录结构。
You could use tar. It's the fastest way I found.
This command compresses the contents of SOURCE_FOLDER into a tar archive and then extracts that archive into DESTINATION_FOLDER, preserving the directory structure.