Search This Blog

Friday, August 27, 2010

How to display specific line of file specifying line number.

How to display specific line of file specifying line number.

#awk 'NR==2{print $0}' filename

This will display 2nd line of file named filename.

Another way of doing the same thing (compact one)

#awk 'NR==2' filename

1 More (complex one)

#head -2 filename | tail -1

More will be coming soon.

Please Leave us with your comments and Queries/Suggestions.
I will try to reply asap.

No comments:

Post a Comment