Tag Info

New answers tagged

1

Append line after match sed '/\[option\]/a Hello World' input Insert line before match sed '/\[option\]/i Hello World' input Additionally you can take backup and edit input file in-place using -i.bkp option to sed


1

Yes, it's possible with sed: sed '/pattern/a some text here' filename An an example: $ cat test foo bar option baz $ sed '/option/a insert text here' test foo bar option insert text here baz $



Top 50 recent answers are included