Linux – How to create an MPlayer playlist with a shell script?

linuxmplayer

I am trying to create a shell script in Linux that when executed searches a directory for all media files then creates a playlist and plays it with MPlayer.

Best Solution

Use this command :

find /PATH/TO/MUSIC/DIRECTORY/ -type f -iname "*.mp3" > playlist.m3u

Now play with mplayer :

mplayer -playlist playlist.m3u