-1

I have a file test.txt. It has 120 lines in it. I want to add on line 70 a new line "test" so I get:

line 68
line 69
test
line 70
line 71

How can I do it in one line command without using text editors such as vim?

vesii
  • 203

1 Answers1

5
sed -i '70i test' test.txt

is what you need to enter.