Tip: easy shuffling of a set of lines

Oct 29, 2013 • Remi Emonet

I had to shuffle my mcq answers and I want to share how I did it.

Given a file “answers.txt” (or a dataset in other contexts) containing one answer/entry per line, you can just use:

cat answers.txt | sort -R

Enjoy “sorting” randomly.
Rémi