How can I create a a playlist file of all of the mp3s in the current directory from the terminal?

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.


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

You could try the following command (while in the directory with the needed mp3s):

find `pwd` | grep .mp3 > playlist.m3u

You can then pass this to a program that accepts playlists via the command line.