This question already has answers here:
Closed 6 years ago.
In a Bash script, I want to pick out N random lines from input file and output to another file.
How can this be done?