bashunix

How do I flatten a single level of directories in a shell command?


I've found lots of scripts which will recursively flatten all the contents of the subfolders and the subfolders of those subfolders of a directory. But I just want to flatten one level and keep the subfolders intact. How would I go about doing that with maybe a bash script?


Solution

  • mv */* .
    

    If you don't care about hidden directories, it's as simple as that.