Thursday, September 25, 2008

Shuffle lines of a file

Where would I be without tab completion? Not only has it destroyed my typing ability, but today it helped me find a command I've wanted for a long time: shuf, which randomly shuffles input lines.

$ shuf /usr/share/dict/words |head -1
banefullest

2 comments:

bawb said...

Oh, awesome.

bawb said...

I wonder whether shuf -n optimizes for small n.