0

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.

1 Answers1

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