6

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
  • 188,989
  • 46
  • 291
  • 292
RoundRobin
  • 99
  • 1
  • 2
  • 9

1 Answers1

14

Use this command :

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

Now play with mplayer :

mplayer -playlist playlist.m3u
mah454
  • 1,571
  • 15
  • 38
  • 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