Protect Your Dream, Protect Your Happiness.
Thursday, June 26, 2014
Linux command to display specific lines in the middle of a huge file
There are two solutions if you know the line number but nothing else (no grep possible):
Assuming you need lines 20 to 40,
sed -n '20,40p' file_name
or
awk 'FNR>=20 && FNR<=40' file_name
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment