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 450 times
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,789