#!/bin/bash find . -type f -mindepth 2 -exec mv -vn -- {} . \; find . -depth -mindepth 1 -type d -empty -exec rmdir {} \;