I have always had historic interest of various UNIX tools and the UNIX itself. One day when I was learning sed, the stream editor, (sed cheat sheet) I got interested how much the most powerful text editing tools on UNIX - 'ed', 'ex', 'sed' and 'vim' (or just 'vi') had in common and what they borrowed from one another.

I was not perfectly sure if 'sed' has originated from 'ed', so I Google searched for 'sed history' which turned up some interesting results, one of them being "The original users manual for sed, by Lee E. McMahon, from the 7th edition UNIX Manual (1978)".

Quoting the manual "Sed is a lineal descendant of the UNIX editor, ed." Great! I knew that 'sed' was non-interactive text editor whereas 'ed' was an interactive one. Also I knew that 'ex' was improved 'ed' and that 'sed' was a non-interactive 'ed' and that 'ex' had become 'vi' and was used in 'vi' command line mode. To boost my vi/vim skills and get a touch on how text editing was done with just 'ed', and satisfy my historical curiosity I set myself a goal to learn it.

As I mentioned in awk and sed cheat sheet posts, the best method for me to learn a new tool is to have all commands in front of me, so when I am doing experimentation I can quickly find the command and also see all the other commands at the same time, blowing them in subconsciousness.

Since 'ed' is line-oriented text editor, it is important to understand the line addressing, this cheat sheet summarizes the line addressing.

Most of 'ed' command are single letter in length. This cheat sheet summarizes all the commands, showing the supported address ranges and a detailed description of each command.

From my experience, once I had completed this cheat sheet and had it in front of me, I picked 'ed' up in 30 minutes. And then spent a few more hours experimenting and trying various constructs.

Have fun learning ed!

Download Ed UNIX Text Editor's Cheat-Sheet

Plain Text (.txt):
Download link: ed text editor cheat sheet (.txt)
Downloaded: 31147 times

Download link: ed text editor cheat sheet (.pdf)
Downloaded: 49979 times

Microsoft Word 2000 format (.doc):
Download link: ed text editor cheat sheet (.doc)
Downloaded: 10535 times


Peter Crouch Permalink
September 04, 2008, 22:27

Personally I prefer this plain and simple old school text editor:

September 11, 2008, 10:11

Seriously ? you're learning ED in the 21st century ?
(oh my).
Now, maybe ED is way more powerful than EDLIN, the ED-inspired editor of MS-DOS 3 which i have been forced to use in early days ... I can tell you it *really* made me regret the C64's BASIC edition mode (list 1-n giving you n first lines, and re-typing over existing lines replaced them).

kilves76 Permalink
July 30, 2012, 04:24

The point of learning ed is to become better in using (g)vi(m). When you know the history (ed>ex>vi) of the command you use, the commands will make more sense.

(yes i know i'm replying to a 4 year old post...)

iokanuon Permalink
February 28, 2016, 01:46

What's wrong with replying to 4 year old posts?

Heavenly General Permalink
June 30, 2017, 08:45

Well, may be he thought the post was outdated.

By the way, right now, I am learning ed. And, I find great joy in practicing the editor.

I am here actually because of Google. I searched how to activate ed command history (if any of course).

And so far, I get none.

Well, even if there is no command history, at least I have verbose error message (H) and a prompt (P).

Ogre Permalink
February 10, 2009, 19:16

I was looking for an rtf viewer/editor for unix and had to stop by. I frequently use ed when building ad-hoc scripts. It is the ONLY editor that enables me to change the second occurance(or 3rd) of an RE. Ex and vi change the number of occurances starting with the first. For example: Applying the same sed-script to 99 files and directing the output to a different directory, I need to change the second directory. I usually use ls to find the files I want, past the list to itself, insert 'sed -f changes' in front of each file, then change the second(output) directory. ed is the only way to change the second directory name. In 60 seconds, plus the time to build whatever sed script I need for these files, I have them changed and in another directory.

Adrian Permalink
May 25, 2009, 19:38

Yes, ed is a small, powerful tool – if you know how (and when!) to use it wisely, it can certainly save the day. But somehow I wonder (please don’t get me wrong on that): Why did you compile the cheat sheet? In my humble opinion, the manpage is basically just as good. (It is slightly longer, but it also covers a few more issues.) If you prefer to read it on paper, you can run

man -t ed

to have the manpage pretty-printed as PostScript. Redirect the output into a file, or pipe it directly to the printer.

Heavenly General Permalink
June 30, 2017, 08:49

In my opinion, the info manual is even better. I am learning the editor from the info manual by today.

christophe Permalink
September 07, 2010, 09:26

Hi! Do you know if there is multiple implementation of ed ? Thanks ;)

January 18, 2011, 05:58

plz send me ex and ed editors program in unix

UNIXgod Permalink
April 26, 2011, 05:22

Kumar if your distro does not contain ex and ed check out FreeBSD. It's historically accurate.

Leave a new comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "cdrom_16": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.