Thursday, April 17, 2014

How to see a line in a file

To see line 50201 in a file combine head and tail commands

head -50201 filename | tail -1

Command:
head -50201 filename
will list you all lines in a file starting from the beggining to the line 50201
But when combined with
tail -1 
it will show only the last line of this head selection and that is line 50201

No comments:

Post a Comment