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