bash flatten folders code example Example: bash flatten directory find /dir1 -mindepth 2 -type f -exec mv -t /dir1 -i '{}' +