Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 11.10 (I don't think that really matters) with Bash.

How can I make a music playlist out of a .txt file? It is a command but I forgot it. I would appreciate it if someone would write a tutorial.

share|improve this question
up vote 3 down vote accepted

You have to go to the folder of the music, than type:

ls > music.txt

The .txt file can be named what ever you want. The ls uses all the files in the folder, listing them and the > redirects the command to a .txt. Than press Enter or Return and that's it. If you are using mplayer for example, you type

mplayer -playlist music.txt
share|improve this answer

There are many playlist formats.

M3U is a simple plain text file format for playlists. Where each line is a location (this can be a relative path, an absolute path or a URL). Example (a_playlist.m3u):

/foo/bar/Eternal Wheel.flac

With mplayer I could play the above like so:

mplayer -playlist /path/to/a_playlist.m3u
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.