0

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.

3
  • Your expected actions are not very clear. An example may clear out your problem. However, if you are just renaming files, the rename command (file-rename) may do the job. But, if you need to move around files, you may have to write a Bash script.
    – FedKad
    Nov 15, 2022 at 13:22
  • Example of folder hierarchy: FLAC CDs 'BB King' 'Classics' mp3 (contains .mp3s of all songs in the above subfolder) Non-CD (same hierarchy as above) All subfolders under an 'artist name' folder contain an mp3 folder. What I want to do is rename each mp3 subfolder to 'artist name' - 'album name'. Then I want to move each renamed subfolder to a different directory (for example ~/temp). I know I can use the proper string on each second-level folder. Hope this clarifies things a bit.
    – delta1071
    Nov 15, 2022 at 21:14
  • My music collection folder has one TLD named FLAC. In the FLAC folder are two subdirectories - CD and Non-CD. In each of these subfolders there are multiple folders, each named for a specific artist. In each of these artist folders, there is a subfolder for each album by that artist. In each album subfolder, there is a folder named mp3 containing the mp3 files of that album. I want to rename each mp3 folder to the name of the album, then move all the renamed folders to a different directory (e.g ~/temp). I do not want to rename any files, only the mp3 folders.
    – delta1071
    Nov 15, 2022 at 21:25

0

You must log in to answer this question.

Browse other questions tagged .