Follow me on Twitter for my latest adventures!
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.
Good luck with learning ed! :)
And don't forget: ED IS THE TRUE PATH TO NIRVANA!
ps. if you notice any inaccuracies, spelling or grammar errors, please leave a comment here, so I can fix it. Thanks!
pss. logo for this article from mr. ed comedy ;)
Download Ed UNIX Text Editor's Cheat-Sheet
Plain Text (.txt):
Download link: ed text editor cheat sheet (.txt)
Downloaded: 17112 times
PDF:
Download link: ed text editor cheat sheet (.pdf)
Downloaded: 29203 times
Microsoft Word 2000 format (.doc):
Download link: ed text editor cheat sheet (.doc)
Downloaded: 2774 times


Facebook
Plurk
more
GitHub
LinkedIn
FriendFeed
Google Plus
Amazon wish list
Comments
Personally I prefer this plain and simple old school text editor:
http://home.online.no/~westerma/WestEdit/
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).
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...)
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.
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
to have the manpage pretty-printed as PostScript. Redirect the output into a file, or pipe it directly to the printer.
Hi! Do you know if there is multiple implementation of ed ? Thanks ;)
plz send me ex and ed editors program in unix
Kumar if your distro does not contain ex and ed check out FreeBSD. It's historically accurate.
Leave a new comment