R.A. Epigonos et al.

[linux] findとxargsとmvで高速ファイル移動

移動するファイルをfindで指定。これをxargsに渡して、1つづつ10プロセス並列で移動

142日前に作られたファイルをfindで検索。xargsに渡して、10プロセス並列でmvに一つづつ引数で渡す。

$ find -ctime +142 -print0 | xargs -0 -t -n 1 -P 10 -r mv -i --target-directory=/path/to/

リファレンス

  1. Man page of MV
  2. Man page of FIND
  3. Man page of XARGS

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2010-05-27T00:16:27+09:00
  2. Modified: 2010-05-27T00:16:27+09:00
  3. Generated: 2023-08-27T23:09:10+09:00