One Thing Well

A weblog about simple, useful software.

You can follow along on Twitter or via the feed. Don't hesitate to get in touch. Sponsor the site.

Play

I have the following aliased to play in my shell config file:

mplayer -playlist <(find "$PWD" -type f | sort -n)

In plain English, that finds files in the current directory, sorts them numerically and feeds the resulting list to mplayer (so it’ll only work properly if your music files are numbered).

Not the most sophisticated way of listening to music, but if you’re an old-fashioned ‘choose an album, listen to it from start to finish’ person, it does the job.

Update: André got in touch to suggest the following, which prevents mplayer choking on, eg., cover art, by restricting the scope of the one-liner to MP3 and Ogg files:

mplayer -playlist <(find "$PWD" -type f -iname "*.mp3" -o -iname "*.ogg" | sort -n)