How to print the lines between two line numbers in unix

How to print the lines between two line numbers in unix ? I want this to be implemented in the script.
kranthi_50404Asked:
Who is Participating?
 
saurabhpendharkerCommented:
Hello,
perl -ne 'print if 3 .. 5' input.txt  (To read lines between 3 and 5 line numbers in input.txt)
0
 
sunnycoderCommented:
sed -n '2,6p'  inputfile

2 is the start line no and 6 is the end line no
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.