DEV Community


ed is the standard text editor.

Evan Jones
・1 min read

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.

Discussion (0)