Skip to content

Instantly share code, notes, and snippets.

@ddneat
Last active October 9, 2020 09:01
Show Gist options
  • Save ddneat/8190495 to your computer and use it in GitHub Desktop.
Save ddneat/8190495 to your computer and use it in GitHub Desktop.
listen to random music with afplay
brew install gshuf
find *.mp3 | gshuf -n 1 | tr '\0\n' '\n\0' | xargs -0 afplay
@ddneat
Copy link
Author

ddneat commented Dec 31, 2013

gshuf is an alternative to sort -R and identical to the unix common shuf command. each gshuf command comes with g prefix. gshuf is needed because osx is shipped without sort -R and the shuf command.

@ddneat
Copy link
Author

ddneat commented Dec 31, 2013

if necessary just install the missing gshuf package on your mac

@secwang
Copy link

secwang commented Aug 12, 2015

very useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment