将每个子目录移动到当前目录的 Shell 命令

这是一个使用 find 将每个子目录移动到当前目录的简单命令,必要时重命名同名目录。

move_subdirs.sh
find . -mindepth 2 -type d -exec mv -v -t . --backup=numbered -- '{}' +

Check out similar posts by category: Linux