Q: How do I insert a text line at row 3 in file "test" using sed?
 

A: The below inserts a new line at row 3 with the string "sometext" in a file called "test.txt"

# sed -i '3isometext' test.txt 

Hits: 621