On Wed, Sep 22, 2010 at 9:53 AM, Al <oss.el...@googlemail.com> wrote: > Hi, > > I am looking for a program similar to head or tail. It should display > a given range of lines or take a line and a context number like grep. > > Any suggestions? Thanks in advance.
sed -n 5,8p filename where 5 is first line in the range and 8 is the last line. If you want to view multiple ranges use the same X,Yp syntax but preceed each with -e. For example sed -n -e 5,8p -e 12,17p filename