$ sed 's/old/new/[flags]' [input-file]

Flag Description
g Global substitution
1,2... Substitute the nth occurrence
p Print only the substituted line
w Write only the substituted line to a file
I Ignore case while searching
e Substitute and execute in the command line
Comments