linux refresh directory code example
Example 1: bash flatten directory
find /dir1 -mindepth 2 -type f -exec mv -t /dir1 -i '{}' +
Example 2: delete directory linux
rm -rf dir1
find /dir1 -mindepth 2 -type f -exec mv -t /dir1 -i '{}' +
rm -rf dir1