sed

Updated: Feb 20, 2018 by Pradeep Gowda.

To insert text “hello world” at line 3 in greeting.txt:

$ sed '3a\

hello world ‘ greeting.txt