I have several folders in the following structure that I would like to sort.
/root/sub1/aaaa/bbbb/cccc/dddd /root/sub2/aaaa/bbbb/cccc/dddd /root/sub3/aaaa/bbbb/cccc/dddd /root/sub4/aaaa/bbbb/cccc/dddd
These are nested folders with nothing in them except for the next folder.
I want to cut the path to this
/root/sub1/dddd /root/sub2/dddd /root/sub3/dddd /root/sub4/dddd
I do not want to move the folders to the root level folder but to just below their parent folder.
The best command I can think to run is this:
However this would bring everything to the root level.
Or I could run the command inside each sub folder however this would still be tedious.