Sunday, May 3, 2009

SED examples

SEDis a Unix utility which parses text files and implements a programming language which can apply textual transformations to such files. It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script), and then outputs the line. Below are some examples on how SED is normally used.

replace a string, save in a new file:

sed -e 's/VMS/Unix/g' file >

delete all lines starting with "Novell":

sed -e '/^Novell/d' file >

Readers who read this page, also read:

Bookmark and Share My Zimbio