Some file copying went wrong in one of my machines and I'm wasting a ludicrous amount of space by having a copy of each folder inside of the parent with the same name, and I want to delete them all.
/mnt/test/files/foo \_ /mnt/test/files/foo/file1 (etc) |__ /mnt/test/files/foo/foo \_ /mnt/test/files/foo/foo/file1 (etc) |_ /mnt/files/foo/foo2 \_ /mnt/files/foo/foo2/file1 (etc) |_ /mnt/files/foo/foo2/foo2 \_ /mnt/files/foo/foo2/foo2/file1 (etc)
So obviously I want to delete
/mnt/files/foo/foo2/foo2 and its contents (and so on) entirely and stop wasting space. What would be a good way to script it in bash?