Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

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

Your Answer


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.