How would I search a directory of mp3 files for songs between a certain length. Ex:
findmp3 -min=03:00 -max=03:15 /music/mp3/ebm/
Would return all mp3 files in the emb/
directory having a song length between 3:00 and 3:15 minutes in length.
I use Linux Mint, Ubuntu, as well as CentOS.
Best Answer
First install
mp3info
, it should be in the repositories of your distribution (you have not said, so I assume you are using Linux of some sort). If you have a debian-based distribution, you can do so withOnce
mp3info
is installed, you can search the directorymusic
for songs of a certain length with this command:The command above will search
music/
for mp3 files, and print their name and length if that length is grater or equal to 180 seconds (3:00) and less than or equal to 195 seconds (3:15). Seeman mp3info
for more details on its output format.If you want to be able to enter times in MM:SS format, it gets a bit more complex:
Save the script above as
findmp3
and run it like this: