Last Updated: February 25, 2016
·
362
· rockerfeller

Search in a song directory and play matching files

Listening to music in the terminal makes you look like a deep hacker.

However using mplayer to chose every song is demanding. On the other hand, listening to a whole directory forces you to listen to some songs that you don't really want to ear.

This approach let's you choose files containing a particular string and listen to all of them one after the other.

ls | grep -i "artist name" | xargs -I {} mplayer -novideo "{}"

You could use a regexp with grep -P , but yeah, relax.

Note, you need mplayer:

#your distro
somepackagemanager someinstallcommand mplayer
#debian
apt-get install mplayer