Friday, June 26, 2009

Play music clean, on command line!

If you wanna play music randomly, without bothering to import songs or make playlists, try out the following command.

$find /media/ -name "*.mp3" | xargs -d '\n' -n10 mpg123 -Z

It would look for all '.mp3' files in the directory '/media' and all its sub directories and play them randomly.

Just dont bother to search songs on your pc, let the command do it for you!

xargs would add the result of find command as arguments to the mpg123. -d option would specify the delimiter and -n would specify the no. of arguments to be taken at a time as there are command line length limitations.

No comments:

Post a Comment