Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I have installed Ubuntu 11.10 server.. so command line only.

I need to be able to play audio (.mp3 & .wav) files via the command line!

I've installed the MPD & Audacious packages... and copied some files to a location specified in the .conf file.

But what do I do to acutally play the .mp3 files??

Also, how can I confirm the AUDIO is working correctly?

share|improve this question
You want to play it from the 'server' speakers or you want to play it across the network? Two very different things. – hbdgaf Mar 23 '12 at 12:17
Audio through jack output, not over network (initially). – user51760 Mar 23 '12 at 15:20
You could try installing sox, then at the commandline it would be "play thisorthat.mp3" or "play ~/music/thisfolder/thisorthat.mp3" – tufkab Jul 3 '13 at 22:12

9 Answers 9

For wav you can use aplay. For mp3 you can use mpg123.

share|improve this answer
Thanks for this... mpg123 worked perfectly. – user51760 Mar 23 '12 at 15:09

I usually just do mplayer foo.mp3 to play audio from the command line.

share|improve this answer
Thanks, I'll install the mplayer package and test it. – user51760 Mar 23 '12 at 15:20

If you already have ffmpeg installed (you should have ffmpeg installed default with ubuntu), try:

ffplay example.mp3
share|improve this answer

You can test the sound quite simply: speaker-test -c6 (where -c6 indicates I want to test 6 channels for a 5.1 setup)

But for playing music, mpd is just a server.

It needs a frontend to tell it to do things. Check out mpc for a fairly basic command line player. There are of course many, many clients (including graphical ones you can connect over the network) so you can play around with those.

share|improve this answer
Excellent, thanks for the speaker-test.... worked great. I'll also check out mpc. – user51760 Mar 23 '12 at 15:15

Not sure if your server will support it, but VLC also has a command line version that can play (with the right packages) MP3 files:

nvlc file.mp3

The 'n' in front of 'vlc' invokes the ncurses interface which is for the command line. This allows you to play multiple files, pause and control the files being played.

share|improve this answer

The play command from the sox package will play any file format supported by sox

To install sox open terminal and run:

sudo apt-get install sox
sudo apt-get install sox libsox-fmt-all

To use play command:

play file_name.extension

Use man sox for more information

reference here

share|improve this answer

I like libgnome2-0.

sudo apt-get install libgnome2-0

Then, after you have installed this program, all you have to do is type this:

cd Music
gnome-open example.mp3

Just replace "example" with whatever your mp3 file name is and "user" with your username.

share|improve this answer

vlc (aka VideoLAN) has a built-in command-line mode (a full shell interface), you can cd to a directory with media in it and run vlc . to start playing, or vlc somefile.mp3 to play a single file.

There is also the nvlc ncurses-based interface for VLC, which isn't available on all platforms.

share|improve this answer

You told you have audacious installed. You can play audio file in command line by audacious -hq file.

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.