I want to output all lines between a and b in a file.
This works but seems like overkill:
head -n 900 file.txt | tail -n 100
My lack of unix knowledge seems to be the limit here. Any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will print (
p) lines 800 through 900, including both line 800 and 900 (i.e. 101 lines in total). It will not print any other lines (-n).Adjust from 800 to 801 and/or 900 to 899 to make it do exactly what you think “between 800 and 900” should mean in your case.