a command to get the lines around a specific line of a text file

Posted by sanjan on Server Fault See other posts from Server Fault or by sanjan
Published on 2010-05-27T03:53:11Z Indexed on 2010/05/27 4:02 UTC
Read the original article Hit count: 203

Filed under:

I'm looking for a command to get text around a specific line of a file.

ex: file content:

a

b

c

d

e

f

g

h

i

j

a command like: ]$ commandname -text f -lines 3 giving the output

c

d

e

f

g

h

i

© Server Fault or respective owner

Related posts about text