Get the app

Just about any Linux distribution with online repositories will have this package available, normally as just mpg123. Ubuntu users can find it in the Software Center or from the command line with In the event that your distribution does not have binaries available, you can download the source code here.

The Basics

A single track can be played in a simple and pretty obvious way, just mpg123 followed by the filename, as in: Which will play the single track from start to finish with output something like this:

Playlists

You can also use shell wildcards to send mpg123 several files at once. The simplest example is to use the above method, but replace the filename with a quick and easy *.mp3. To set your playlist to shuffle mode, just add a -Z in there

Optionally, you can use normal bash redirect characters to feed mpg123 a list of filenames.
The -@ flag tells mpg123 to treat the following input as a playlist (it’s the shortened form of –list), and the < is a standard bash redirect to pull the text out of the file and use it as mpg123’s input.

Remote Play Control

This isn’t exactly a “feature” of mpg123, it’s more like a side effect, but for this author, it’s the most handy thing about this application. You see, regular readers or Linux pros probably already know about SSH, the fantastically useful remote shell application with 1001 uses. Since SSH gives you a shell on a remote machine, you can run programs on that remote machine. As mpg123 is just another shell application, the normal rules apply. If you SSH into a machine and run mpg123, it will play out that machine’s speakers.
This is great for me. If I’m sitting on the porch with my netbook on a fine summer day, I can SSH into my desktop (which is hooked up to a home theater) and run a mpg123 to start my music without ever leaving the chair, or being forced to deal with the low-quality underpowered netbook speakers. Just SSH into the machine and run mpg123 as if you were sitting at the keyboard, as in

Conclusion

If you like tag-based music libraries, album art, device synchronization, and other fancy features - mpg123 is clearly not a solution for you. In fact, I doubt there are many people who’d want to use this as their primary music player on a day-to-day basis, but there are certainly times when it comes in handy. We’ve explored just a few of them, and I’m sure our readers can come up with quite a few more. If you’ve found a great use for mpg123, please let us know in the comments.