Flatten a Nested Directory & File Hierarchy from Command Line of Mac OS X
Have you ever needed to flatten a directory structure, moving all file contents from a directories child folders into a single folder? While you can do this manually by moving around files and folders from the file system of Mac OS X or Linux, a faster option is to turn to the command line. Maybe at one point you created a nested hierarchy of directories that you now need to undo by moving all files out of those nested folders and back into a single directory, or maybe you’re looking to simplify a directory structure, whatever the reason, this trick works quite well.