A Command to display a specific line??
Hello,
i'm new to linux, and i'm also taking a course on it, so i need some help :) the question is: The file 'threelines' contains 3 lines of text. Display the middle line on the screen. You are not allowed to use the 'more' command. try using a combination of head and tail thank you. |
Hi,
A few ways to do this. Here is one: tail -2 <file> | line Another way: number the lines with 'nl <file>' and use grep (nl <file> | grep -w 2). |
With head and tail only:
tail -2 <file> | head -1 |
that worked perfectly thank you :D
|
|
Quote:
|
Quote:
|
gotten?
Got is already in past-tense there is no need for you to add the 'ten' at the end.
|
All times are GMT -5. The time now is 07:36 PM. |