Unix 移动所有子目录下文件到文件夹

you can use find with xargs for this

find /thisdir -type f -name "*.ogg" -print0 | xargs -0 -Imysongs mv -i mysongs /somedir

The -I in the above command tells xargs what replacement string you want to use (otherwise it adds the arguments to the end of the command).

OR
In your command just try to move '{}' after mv command.

find /thisdir -type f -name '*.ogg' -exec mv -i {} /somedir \;

你可能感兴趣的:(Unix&Linux)