got a problem here with sed on the command line. To insert after, you want "a" (append). I tried the following but it doesn't work: *User/,$p' > consumers.txt. e.g. There are two ways to insert a line after a match is found in a file that is mentioned below. ... All, Sep 16, 2009.