Before going to learn SED a brief intro is required.
a) sed is a Stream EDitor.
b) It reads line by line when a file is fed to it.
c) sed will not edit the input file by default and it displays output on the screen.
d) SED is mainly used for search for a term and replace with desired term in a file/stream.