Posted By

Juanje on 05/30/08


Bash files sed shellscript

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Show few lines from a file with sed

 / Published in: Bash

Some times you need some specific range of lines from a file and the commands 'head' and 'tail' are not enough for you. This could be a easy solution for this problem.

  1. # show from line 12 to line 23
  2. sed -n '12,23 p' archivo.txt
  4. # or just one (line 15)
  5. sed -n 15p archivo.txt

Report this snippet  

You need to login to post a comment.