ed is the Standard Text Editor

Please note: this was a test post for a fresh account I created for myself on https://dev.to/. You can find the original here.

ed (pronounced "e" "d" -- not "ed" as in Ed, Edd n Eddy) is a line-oriented text editor. ed was originally written by Ken Thompson for use in various UNIX systems. Don't let the man(1) page lie to you: ed is not superseded by full-screen editors such as GNU Emacs or GNU Moe. If you tend to shy away from user interfaces, clinging to your sh(1) prompt to get work done, ed may be another valuable rendezvous for your time out of the meatspace -- after all Vi does mean "visual" editor.

ed doesn't do much without being asked to. What ed does do is:

  1. Append text to a buffer.
  2. Print text from a buffer.
  3. Replace lines in a buffer.
  4. Deleted line from a buffer.
  5. Read files.
  6. Write files.
  7. Put/yank text.
  8. Execute shell commands.

That's almost it.

What I'll show you are the bare essentials to using ed. We're going to write a hello world program in ed using the C programming language.

We'll begin by entering a shell prompt, sh(1) will do. Follow along with me in my terminal.

using ed

Sure beats the hell out of using punch cards.