GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Select Lines from File |
20191222 The shuf command will select random lines for the specified file.
$ shuf -n 10 myfile.txt |
To select the Nth line from a file (replacing N with the line number you want):
$ sed 'Nq;d' myfile.txt |