find と xargs を利用して、大量のファイルを指定したディレクトリに移動させる。
例えば、「.sql」の文字列を含む名称のファイルを指定したディレクトリに移動する場合、
Linux では、
% find ./ -type f -name "*.sql" -print0 | xargs -0 -I{} mv {} /enter/a/directory/to/the/destination/
や
% find ./ -type f -name "*.sql" -print0 | xargs -0 mv -t /enter/a/directory/to/the/destination/
で実行できる。
ただし、後者の方法は、mv が GNU 版のコマンドであることが前提になる。
FreeBSD の場合
% find ./ -type f -name "*.sql" -print0 | xargs -0 -I{} mv {} /enter/a/directory/to/the/destination/
で実行できる。