Tuesday, February 2, 2016

Tired of having to sort through all of those .mp3 folders?
Copy them all into one directory using this command!
For Linux/Bash Users only!

Open a terminal and enter this:

find /home/USER/Music -name '*.mp4' -exec cp --backup=numbered -v -t /home/USER/NEWFOLDER/ {} +

This command will need to have the USER field replaced with your username, and also have the NEWFOLDER field replaced with the desired folder name.
This command will find all of the .mp3 files in the users Music folder and all it's subfolders, then execute a copy command which will place them all into one output folder called "NEWFOLDER" and give all duplicate files a name enumerated by a number in the new filename to distinguish them from one another.
For example, if the are three files with the same name, two of the will get numbers attached to the filename in numerical order. Ie. Music.mp3, 1Music.mp3, 2Music.mp3, etc..

**NOTE: Remember to change '/home/USER/Music' to match the location of your target files!

No comments:

Post a Comment