October 2001
Intermediate to advanced
1040 pages
22h 50m
English
Sed commands tell sed how to process each line of input specified by an address. If an address is not given, sed processes every line of input. (The % is the csh prompt.) See Table 4.1 for a list of sed commands and what they do, and see Table 4.2 for a list of options and how they control sed's behavior.
% sed '1,3d' file
|
EXPLANATIONSed will delete lines 1 through 3. |
| Command | Function |
|---|---|
| a\ | Appends one or more lines of text to the current line. |
| c\ | Changes (replaces) text in the current line with new text. |
| d | Deletes lines. |
| i\ | Inserts text above the current line. |
| h | Copies the contents of the pattern space to a holding buffer. |
| H | Appends the contents of the pattern space to a holding ... |
Read now
Unlock full access