findで古いファイルをmv

とりあえず

↓でできる。

find ./ -type f -ctime +7 | xargs -I{} mv {}  old

でも

mvの-tオプションで実行できないのは面倒。

Mac のコマンドを強化するGNU coreutils - Slow Dance

ls, find とmv はコンボしたいだろJK ( ゚д゚)

そこでGNU coreutils ですよ

まさにその通り。

なので入れてみた

$ sudo port install coreutils
--->  Fetching coreutils
--->  Attempting to fetch coreutils-6.12.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/coreutils
--->  Verifying checksum(s) for coreutils
--->  Extracting coreutils
--->  Configuring coreutils
--->  Building coreutils
--->  Staging coreutils into destroot
--->  Installing coreutils @6.12_0
--->  Activating coreutils @6.12_0
--->  Cleaning coreutils

実行結果

すてき!

$ find ./ -type f -ctime +7 | xargs gmv -t old