Hi Guys,
I am newbie here and greeting to all guys of unix forum, now I want to learn unix here.
I have query here, we have file where file has 20 line record, now i want display 10 to 15 line row record only, then how it possible.
Hi Guys,
I am newbie here and greeting to all guys of unix forum, now I want to learn unix here.
I have query here, we have file where file has 20 line record, now i want display 10 to 15 line row record only, then how it possible.
Hello Aditya321,
Welcome to forum, we hope you will enjoy learning new things here.
Following may help you in same.
awk 'NR>=10 && NR<=15' Input_file
Thanks,
R. Singh
sed -n 10,15p file
Thank you so much Ravinder & Scrutinizer.
We can achieve this by head and tail command also.
head -n 15 file | tail -n 6
how about
awk 'NR == 10, NR == 15 { print $0 }' infile
you could use vi and then
:10,15w!/infile
or in perl
perl -ne 'print if 10..15' infile