Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to display from line 10 to line 23 in from passwd using tail?

I know that using tail -1/etc/passwd It will display last line from passwd

So please help.

share|improve this question
add comment

2 Answers

Like Squall5668 posted, you would have to use head and tail programs together. As an alternative, you may prefer to use sed as a single command, like this

sed -n '10,23p' filename
share|improve this answer
add comment

You can combine the commands "head" and "tail" like so:

head -n23 filename | tail -n14
share|improve this answer
1  
can I make using tail only ? –  Ayman Nov 20 '12 at 12:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.