不能用find和exec移动?

Can't move with find and exec?

我有一个简单的问题,我无法解决。我在 /root/php 中有多个文件,扩展名为 *.php

如何使用 find 和 exec 将所有文件移动到目标文件夹:

find /root/php -name "*.php" -exec mv /root/php/{} /root/destination/ \;

错误:

mv: cannot stat '/root/php//root/php/asjdoiasdj.php': No such file or directory

试试这个:

find /root/php -name "*.php" -exec mv {} /root/destination/ \;

在这种情况下,您使用绝对路径