I want to replace a string "#security" with "security\n\tauthorization : enabled" in a file file.txt. Here \n represents a new line and \t for tab. How can I do this using sed command.
Asked
Active
Viewed 435 times
0
1 Answers
1
sed 's/#security/security\n\tauthorization : enabled/' file
If you want to edit your file "in place" use sed's option -i
.
See: man sed

Cyrus
- 5,554
sed
on google. Do your research. We are not free "do my homework" service – Sergiy Kolodyazhnyy Jul 01 '16 at 05:46