Select random lines from a file

Use shuf with the -n option as shown below, to get N random lines:

shuf -n N input > output

Leave a Comment