Ubuntu – How to create a a playlist file of all of the mp3s in the current directory from the terminal

command linemp3software-recommendation

I'm looking for a solution to this or a recommendation for a program to check out. I'd appreciate any help.

Update

I would like to use the playlist file with PowerAMP for android.

Best Answer

If an m3u file will suffice, just create a text file containing the directory you want (e.g. /home/user/music_for_playlist/ and save it with an m3u extension. m3u playlists allow this as a special instance, you don't have to enumerate all the files in the directory (your player does that when you open the playlist).

Alternatively, the following will create an m3u playlist containing all the mp3/wav/ogg/wma files in the current directory, this may be better if you want to exclude specific files or re-save the playlist:

find . -iregex '.*\.\(mp3\|wav\|ogg\|wma\)' -print > playlist.m3u