I have spent almost one day and a half searching for this but couldn't find an answer.
I am looking to add the folder's name as a prefix to all files ending with
.bin in that folder.
So, if the folder's name is
ABC and it contains the files
cc.bin, etc. then I need them to be renamed as
Also, this folder
ABC has subfolders, let's call them:
ABC3, etc. which also have
.bin files. For example
I need that command to go through all folders and append that sub-folder's name to files inside it too. So,
aa1.bin will be
ABC1-aa1.bin, and so on.
. └── ABC ├── aa.bin ├── ABC1 │ ├── aa1.bin │ └── bb1.bin ├── ABC2 │ ├── aa2.bin │ └── bb2.bin ├── bb.bin └── cc.bin