如何使用命令或shell脚本将所有文件从子目录移动到Linux中的一个目标目录?
If you are using GNU mv, the -t
option (target directory) is pretty useful:
find sourcedir -type f -print0 | xargs -0 mv -t target
man mv
gives more details.
尝试这样的事情:
find sourcedir -type f -exec mv {} targetdir \;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.