Editing an existing file

To begin editing an existing file, enter:
ed filename
Your current working line is the last line in the file. If you want to change your position in the file before you begin editing, see Identifying line numbers and changing your position in the buffer.
If you are already using ed, have finished editing one file and saved it with the w subcommand, and you now want to edit another file, enter:
e filename
This erases the previous contents of the buffer and loads in the new file.