I've searched for a solution for this, but everything I found relates to renaming files in a subfolder. I want to rename only the subfolders in multiple directories to the names of the parent folders and then move all the renamed subfolders to a different directory. My hierarchy is:
Main folder/subfolder/subfolder/mp3 (and other files)
I want to rename the mp3 folder in each subfolder to the name of the Main folder, while keeping all existing filenames intact. Can someone supply the syntax necessary to perform these operations? TIA.
rename
command (file-rename
) may do the job. But, if you need to move around files, you may have to write a Bash script.