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?
Use shuf with the -n option as shown below, to get N random lines:
shuf
-n
N
shuf -n N input > output
1.4m articles
1.4m replys
5 comments
57.0k users