580 views
Replace text in a file using sed
Replace text in a file to a new file
Text
- sed 's/old/new/g' oldfile > newfile
Replace text in the same file
Text
- sed -i 's/old/new/g' file
Submitted by aanton 10 months ago — last modified less than a minute ago