want to print the file content from the specific line

Hi All,

I would like to print the content from the specific line of a file .

For example... i have file abc.txt which has 100 lines of code ,from this file i would like to print the content from 20,19,18th line......like that

Regards
Srikanth

Use the below awk command

awk 'NR==20 NR==19 NR==18' "abc.txt"

thanks for the reply.. Could you please specify any command to print from 20thline to 1st line instead of giving all the line numbers like above..?

sed -n '1,20p;20q' abc.txt | tac

You can also modify the above awk and use.

awk 'NR==1, NR==20' "abc.txt"