I have a main directory, let's say
main. This main directory has some folders, among which are three folders named
lll, which are the only folders I want to target and work on. Each of these subfolders has some folders inside which are all named the same in the three subfolders, so that
lll subfolders contain folders of the same name.
Then, each of these subsubfolders that are inside
lll has a number of files named with a certain name like this
l_001 and so on.
What I want to do first is rename these files so that the directory of their two parents will be attached in the beginning of the file name like this
lll_foo1_l_000 and so on. I'm asking if anyone can advise me how this can be done in a
This is a simple tree structure of my main folder:
. `-- main |-- ccc | `-- foO1 | | |-- c_000 | | `-- c_001 | | -- foo2 | |-- c_000 | `-- c_001 | | |-- ddd | `-- foO1 | | |-- d_000 | | `-- d_001 | | -- foo2 | |-- d_000 | `-- d_001 |-- lll | `-- foO1 | | |-- l_000 | | `-- l_001 | | | -- foo2 | |-- l_000 | `-- l_001 | |-- aaa |-- bbb