do info sed:
's/REGEXP/REPLACEMENT/[FLAGS]'
(substitute) Match the regular-expression against the content of
the pattern space. If found, replace matched string with
REPLACEMENT.
The 's' command can be followed by zero or more of the following
FLAGS:
'g'
Apply the replacement to _all_ matches to the REGEXP, not just the
first.
'NUMBER'
Only replace the NUMBERth match of the REGEXP.
...................................................................
Command Line Options:
'-i[SUFFIX]'
'--in-place[=SUFFIX]'
This option specifies that files are to be edited in-place. GNU
'sed' does this by creating a temporary file and sending output to
this file rather than to the standard output.(1).