&nbps;Home โœˆ๏ธ Travel โšพ Baseball ๐Ÿ›  Tech ๐Ÿ“˜ Language ๐Ÿ‘จ๐Ÿป Politics About Y Generation  ๐Ÿ˜ˆ
/ tech-note

How to replace a string in a file using sed?

According to the answer over Stack Overflow, you must create a temporary file and mv it to the original file.

For example:

sed -e 'script script' index.html > index.html.tmp && mv index.html.tmp index.html

This is pretty daunting... I wish there were any alternatives...

How to replace a string in a file using sed?
Share this