Question

I recently switched from Mac OSX to Ubuntu and copied all of my music over so it had the iTunes style directory structure and I wanted to be able to type something like:

$ music abbey road

at the command line and hear the album on shuffle or equivalently

$ music beatles

and hear all of the music I have by that artist

Was it helpful?

Solution

I came up with the following zsh function:

function music() {
  mplayer $HOME/Music/**/*(#i)("$*")*/**/* -shuffle
}

the #i here makes it case insensitive

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top