sed (Stream EDitor) - Web Sites


sed (Stream EDitor) is a noninteractive (batch) editor that can quickly edit very large files. It is available for unix and for other operating systems, such as DOS. sed can be used from the command line in a one-liner mode to do quick searches & replaces or deletes in a file. It can also accept its commands from a file, so it is useful in a batch mode. sed utilizes regular expressions, making it very powerful and reasonably easy to learn if you are already using regular expressions as a part of other Unix commands, such as grep, editors, or scripting languages. sed often finds it way into Unix shell scripts. A trivial example of a sed command might be:
sed '/dog/d' fyle
which would delete all lines in the input file ("fyle" above) which contain "dog" (but not "Dog", "dOg", "d og" etc.) as a word or word-part (e.g., hotdog, boondoggle, dog days, the lazy dog, etc.).

sed can be used for much more impressive and complicated tasks, of course. The web sites listed here present much material on the use of sed, including tutorials for the beginner, examples for the expert, and many more sed resources on the Internet.


This sed page has been visited 3802+ times since November 27, 1998.

Back to Kent's Unix Page