Text-editing operations are normally done interactively, inside a text editor application. Some tasks, however, can be accomplished quickly and easily, right from the UNIX command line. What’s more, these one-liners can be used in scripts to automate various editing procedures.
This article demonstrates basic text-editing techniques with three of the most primary command-line editing tools readily available on all systems: cat, ed, and sed. The editing examples that follow start with the simplest and most common constructs and work up to the more complex.
Click here for more..!