I have inherited a folder structure on a project and would like to simplify it a bit. I have a root full of folders (1st level) and each of those folders has a number of folders in it (2nd level) and each of those folders has a some files inside. It looks something like this:
root |-- dir1 | |-- dir1.1 | | +- file1.txt | |-- dir1.2 | | +- file2.txt | +-- dir1.N | +- fileN.txt |-- dir2 | |-- dir2.1 | +- file3.txt |-- dir3 | |-- dir3.1 | +- file4.txt
I'd like to remove all of the x.1 folders, simplify the structure, and move all the files from those folders one level down:
root |-- dir1 | +- file1.txt | +- file2.txt | +- fileN.txt |-- dir2 | +- file3.txt |-- dir3 | +- file4.txt
How would I go about accomplishing something like this through bash/zsh?