![](/img/trans.png)
[英]dir1 and dir2 chmod 700, dir3 chmod 777 but I am getting Permission denied
[英]is there a fastest option to cp files from dir1 to dir2?
我用cp在Linux機器中復制了許多小文件(b / n 1M和10M大小;總共6G左右)。 沒時間 ,但是因為我要一次又一次地執行cp ,所以可以時間了,以后再具體點; 但由於cp並不是主要任務,因此如果有更好的選擇/選擇/方法,則無法忍受花費的時間。 因此,如果有更好的方法/選項/方法可以將cp文件(從一個目錄中快速復制到另一個目錄中),請嘗試一下。
謝謝,
告訴tar / untar或rsync
任何一個,當它們不進行校驗和檢查時,都會更快,因為它們會批量讀取文件,而不是一一對應地處理它們。
你有沒有嘗試過:
time (cd /usr/local/src/ && tar pcf - cvs.gnome.org) | buffer -m 8m -p 75 | (cd /mnt/tmp/src/ && tar pxf -)
(積分: https : //lists.debian.org/debian-user/2001/06/msg00288.html )
您可以嘗試cpio ,因為該目錄具有復制到目錄模式的目錄。
使用perl進行最快的復制:
use File::Copy::syscopy; # preserves OS specific file attributes
copy($foo,$bar) or die "cannot copy $foo to $bar: $!"; # always check for errors!
試試這個只是備份今天的文件:
find /home/me/files -ctime 0 -print -exec cp {} /mnt/backup/{} \;
來自: http : //commandperls.com/find-all-today%E2%80%99s-files-and-copy-them-to-another-directory/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.