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 all occurances 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.
- Read the manual locally using info sed or see the latest online manual
- Search the archives for previous questions and answers:
- General SED resources are available at http://sed.sf.net, including:
- Send translation requests to the language team linked from: http://translationproject.org/domain/sed.html
- Send general questions or suggestions to the mailing list at: firstname.lastname@example.org
Report bugs, including version and distribution variant, to the list at:
Before sending the bug, please consult the FAQ and Mailing list archives (above).
Often these perceived bugs are simply due to wrong program usage.
To learn more about reporting bugs, see Getting help with GNU software
The latest source with revision history can be browsed using
Assuming you have git installed, you
can retrieve the latest version with this command:
git clone git://git.sv.gnu.org/sed
Please note that we do not suggest using test versions of SED for production use.
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 email@example.com 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 firstname.lastname@example.org mailing list .
The main discussion list for all things related to GNU sed is <email@example.com>. 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.
If you think you have found a bug in GNU sed, then please send as complete a bug report as possible to <firstname.lastname@example.org>, 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.
If you would like any new feature to be included in future versions of sed, please send a request to <email@example.com>. 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.