Changes are made to this copy and not directly to file itself. Since ed is line-oriented, we have to tell it which line, or range of lines we want to edit. In the above example, we do this by specifying the line's number, or sequence in the buffer. 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.