GNU sed

sed (stream editor) is a non-interactive command-line text editor.

# Example: delete the 4th line in a file
$ sed '4d' input.txt > output.txt

# Example: replace every occurrence of 'hello' with 'world' on lines 10-20
$ sed '10,20s/hello/world/' input.txt > output.txt

sed is commonly used to filter text, i.e., it takes text input, performs some operation (or set of operations) on it, and outputs the modified text. sed is typically used for extracting part of a file using pattern matching or substituting multiple occurrences of a string within a file.

Getting Help


Stable source releases are available on the main GNU download server (HTTPSHTTPFTP) and its mirrors. Please use a mirror if possible.

Latest Source

The latest source with revision history can be browsed using cgit or gitweb. Assuming you have git installed, you can retrieve the latest version with this command:

git clone git://

Please note that we do not suggest using test versions of sed for production use.

Mailing Lists

You do not need to be subscribed in order to post messages to any GNU mailing list. However non-subscribers are moderated by humans so please be patient when waiting for your email to arrive.

You can subscribe to any GNU mailing list via the web as described below. Or you can send an empty mail with a Subject: header line of just “subscribe” to the relevant -request list. For example, to subscribe yourself to the main sed-devel list, you would send mail to <> with no body and a Subject: header line of just “subscribe”.

It has been necessary to moderate the sed mailing lists to prevent the flood of spam. Postings to the lists are held for release by the list moderator. Sometimes the moderators are unavailable for brief periods of time. Please be patient when posting. If you don't eventually see the message in the list archive then it did not get posted.


Important announcements about GNU sed and most other GNU Software are also made on the mailing list.

Discussion List

The main discussion list for all things related to GNU sed is If you have questions, comments, or other general discussion about sed then this is the mailing list for that discussion. If you don't know where to start then this is the place to start. You can browse and search past postings to the sed-devel archive.

Bug Reports

If you think you have found a bug in GNU sed, then please send as complete a bug report as possible to, and it will automatically be entered into the sed bug tracker. A very useful and often referenced guide on how to write bug reports and ask good questions is the document How To Ask Questions The Smart Way. You can browse previous postings and search the bug-sed archive.

Platform Testing

Trying the latest test release (when available) is always appreciated. Test releases of sed are typically announced on the platform-testers mailing list.

Enhancement Requests

If you would like any new feature to be included in future versions of sed, please send a request to This is the general discussion list and a good place to start discussion of a new feature. After consideration you may be asked to log a request into the bug tracker so that the issue is not lost. If you would like to implement yourself, then note that non trivial changes require copyright assignment to the FSF as detailed in the “Copyright Assignment” section of GNU coreutils HACKING notes.

Mailing List Etiquette

Please do not send messages encoded as HTML nor encoded as base64 MIME nor included as multiple formats. Please send messages as plain text. Please include a descriptive subject line. If all of the subjects are bug then it is impossible to differentiate them. Please avoid sending large messages, such as log files, system call trace output, and other content resulting in messages over about 40 kB, to the mailing lists without prior contact. Those are best sent directly to those requesting that information after initial contact.

Please remember that development of GNU sed is a volunteer effort, and you can also contribute to its development. For information about contributing to the GNU Project, please read How to help GNU.


GNU sed is currently being maintained by Jim Meyering <>, and Assaf Gordon <>.