TECHIES WORLD

For Techs.... Techniques.... Technologies....

CpanelLinux

How to print n'th line of a file in Linux

For printing n'th line of a file in bash, we can use the following command.

sed -n "${c}p" filename

where ${c} is the line number to be displayed.

Leave a Reply