Stream Editor - Basic Commands

Some of the useful SED commands are as follows.
NOTE:-address1 and address2 are the starting and the ending addresses respectively.

Command Description Syntax
Delete Command the delete command is used to perform delete operation or used to delete lines. [address1[,address2]]d
Write Command The write command to store the contents of the pattern buffer in a file. [address1[,address2]]w file
Append Command The Append command is used to append the contents into a file. [address]a\
Change Command The Change command helps replace an existing line with new text. [address1[,address2]]c\
Insert Command The Insert command is used to inserts a line before a specific position. [address]i\
Translate Command The Translate command is used transforms the characters by position. [address1[,address2]]y/list-1/list-2/
l Command The l command is used to display hidden characters in the text. [address1[,address2]]l
Quit Command The Quit command is used to quit the current execution flow. [address]q [value]
Read Command The Read command is used to read the contents of a file and display them when a specific condition matches. [address]r file
Execute Command The Execute command is used to execute external commands from SED. [address1[,address2]]e [command]

Visit :


* You must be logged in to add comment.