# sed command

**URL:** <https://community.unix.com/t/sed-command/166563>\
**Category:** UNIX for Advanced & Expert Users\
**Created:** [November 3, 2006, 8:51am UTC](https://community.unix.com/t/sed-command/166563 "2006-11-03T08:51:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave724001](https://community.unix.com/letter_avatar/dave724001/32/6_22734026db12803ebb3e059622ac3534.png) [@Dave724001](https://community.unix.com/u/Dave724001)\
**Post date:** [November 3, 2006, 8:51am UTC](https://community.unix.com/t/sed-command/166563/1 "2006-11-03T08:51:10Z")

</div>

I have a file which looks something like this:

--#  
--#line1  
--#line2  
--#line3  
--#line4  
--#line5  
--#line6

--#  
line7  
line8  
line9  
.........and so on

Id like to insert a line (2 lines) before the second occurence of "--#" on its own.  
Im having trouble with finding the right sed command to do this, can anyone help me?
