如何bash命令或shell脚本将所有文件从子目录移动到Linux中的一个目标目录?
如果您使用的是GNU mv,那么-t
选项(目标目录)非常有用:
find sourcedir -type f -print0 | xargs -0 mv -t target
man mv
给出了更多的细节
试试这样:
find sourcedir -type f -exec mv {} targetdir ;