My random music player

find /home/user/M?sica/ -type f -name "*.mp3" | shuf --head-count=20 --output=/home/user/playlist.m3u ; sort -R /home/user/playlist.m3u | mplayer -playlist -
This is my favorite music player I use in my beloved Linux systems,server or desktop Enjoy :-)
Sample Output
Reading from stdin...
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/user/.mplayer/input.conf': No such file or directory
Failed to open /home/user/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing /home/user/M?sica/Nativity_In_Black_a_tribute_to_Black_Sab/1-12_Black_Sabbath.mp3.
Detected file format: MP2/3 (MPEG audio layer 2/3) (libavformat)
[mp3 @ 0xb62c4f20]max_analyze_duration 5000000 reached
[mp3 @ 0xb62c4f20]Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: audio (mp3), -aid 0
Clip info:
 title: Black Sabbath
 artist: Type O Negative
 track: 12/12
 album: Nativity in Black a tribute to Black Sabbath
 album_artist: Various Artists
 genre: Metal
 disc: 1
 CDDB DiscID: b10fdf0c
 discid: b10fdf0c
 MusicBrainz DiscID: tuH60Mi7oPEQjt6STaiP414J0Xg-
 musicbrainz_discid: tuH60Mi7oPEQjt6STaiP414J0Xg-
Load subtitles in /home/abaddon/M?sica/Nativity_In_Black_a_tribute_to_Black_Sab/
Selected audio codec: MPEG 1.0/2.0/2.5 layers I, II, III [mpg123]
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  -0.0 (unknown) of 484.9 (08:04.8)  1.1%

By: abaddon
2016-06-10 03:04:40

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: