Linux and UNIX – Fast command line editing examples using cat, ed, and sed. Here is why you need to use command line editing tools…
#1: Text editor takes time for small editing
#2: Use command line editing
#3: Save time and impress your friends [ read as look like an elite UNIX hacker ;) ]
Take a quick look at some essential editing one-liners that can save you time and effort. 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(R) 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.
Read more at developerworks : Save time with text editing one-liners