Subsequent commands affect only the selected line, a.k.a. the current line. In the next example, a title is added to our sonnet. Roses have thorns, and silver fountains mud. Clouds and eclipses stain both moon and sun, And loathsome canker lives in sweetest bud. No more be grieved at that which thou hast done.
Roses have thorns, and silver fountains mud.
Clouds and eclipses stain both moon and sun, And loathsome canker lives in sweetest bud. When ed opens a file, the current line is initially set to the last line of that file. It is possible to modify only a portion of a line by means of replacement, as in the second example above. If fewer addresses are given than the command accepts, then default addresses are supplied. Go to the first, previous, next , last section, table of contents .