How to use sed, a special editor for modifying files automatically. If you want to write a program to make changes in a file, sed is the tool to use.
There are a few programs that are the real workhorse in the UNIX toolbox. These programs are simple to use for simple applications, yet have a rich set of commands for performing complex actions. Don’t let the complex potential of a program keep you from making use of the simpler aspects. I’ll start with the simple concepts and introduce the advanced topics later on.
Full article here:
Sed – An Introduction and Tutorial (Grymoire)