Skip to content

Instantly share code, notes, and snippets.

@flores
Created January 21, 2013 23:55
Show Gist options
  • Save flores/4590701 to your computer and use it in GitHub Desktop.
Save flores/4590701 to your computer and use it in GitHub Desktop.
shuf
root@downoi:~# for i in `seq 1 5`; do echo $i >> numbers; done
root@downoi:~# cat numbers
1
2
3
4
5
root@downoi:~# shuf numbers
1
3
5
2
4
root@downoi:~# shuf -n1 !$
shuf -n1 numbers
1
root@downoi:~# shuf -n1 numbers
1
root@downoi:~# shuf -n1 numbers
4
root@downoi:~# shuf -n1 numbers
4
root@downoi:~# shuf -n1 numbers
5
root@downoi:~# shuf -n1 numbers
4
root@downoi:~# shuf -n1 numbers
3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment