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.
- Sed Command in Linux/Unix With Examples
- GNU sed manual
With download links.- The Basics of Using the sed Stream Editor to Manipulate Text
Basic usage, and covers most of the things you'll use sed for.- A Practical Guide to GNU sed With Examples
A good introduction for those who have never used a stream editor.- A Guide on How to Use the sed Command in Linux
Covers basic usage, the use of pipes with sed, and using sed for editing large files.- Sed One-Liners
Lots of interesting sed one-liners.- sed & awk, 2nd edition
A description of the O'Reilly sed book (1997).
Back to Kent's Unix Page
Last Modified: Sun Aug 31 16:40:01 EDT 2025