5

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.

Michael Myers
  • 178,094
  • 41
  • 278
  • 290
RoundRobin
  • 89
  • 1
  • 2
  • 8

1 Answers1

12

Use this command :

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

Now play with mplayer :

mplayer -playlist playlist.m3u
mah454
  • 1,231
  • 10
  • 25
  • add "sort" to the find, otherwise it won't add the playlist in the right order: find /PATH/TO/MUSIC/DIRECTORY/ -type f -iname "*.mp3" | sort > playlist.m3u – Asaf Nov 19 '14 at 12:03