sed -i 's/original/new/g' file.txt
sed = Stream EDitor
-i = in-place (i.e. save back to the original file)
- The command string:
s = the substitute command
original = a regular expression describing the word to replace (or just the word itself)
new = the text to replace it with
g = global (i.e. replace all and not just the first occurrence)
file.txt = the file name
This entry was posted
on Thursday, May 4th, 2017 at 3:22 am and is filed under Linux.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.