find . -mindepth 2 -type f -exec mv -i -- {} . \; #Move files up find . -depth -mindepth 1 -type d -empty -exec rmdir {} \; #Delete empty directories