Making M3u playlist in Linux console (shell)

Default featured post

I have decided to switch, for a while, to pure text-mode and avoid using GUI. Therefore, I use virtual terminal in my Ubuntu 11.10 (Oneiric Ocelot) which accessible easily with pressing CTRL+ALT+F(X), X could be 1 to 6. If you press CTRL+ALT+F7 you will back to GUI again.

To make it short, I wanted to make a playlist (.m3u) to play my favorite songs in Mpg123 player.

At first it looked difficult but shortly I found a solution. To be exact I use the following commands.

$ cd
$ pwd >> playlist.m3u
$ ls >> playlist.m3u
$ vim playlist.m3u

Then I edit the playlist and add the path before each file name.

Description of the procedure

  1. I put the current path (which is my Music folder) to a file (playlist.m3u). Generally, m3u file is text file and you can open it with text editor.
  2. I redirect the file names to playlist file.
  3. Finally, I edit the file and remove the file names which I do not want to listen and add the path before the names of songs which I want to listen.

Easy, right? Enjoy!