I was a little disappointed this morning when I realized that ed, the curmudgeonly editor that technically dates back 40 years or so in *nix history, wasn’t installed by default on my Arch Linux machine.
I wasn’t surprised though; I can remember a forum debate a few years ago about whether or not it was really critical to the core packages that drew it in. It must not have passed muster, I guess. Hence my wry disappointment. 😐
It’s no major loss. ed is probably the least friendly, least communicative editor you’ll ever encounter … or that I have encountered, anyway.
The trick to using ed is to remember three things:
- ed works line by line. Remember that, and things make more sense.
- ed doesn’t want to give out too much information. Which makes it very Unixy.
- ed hates your guts.
Okay, that last one is a lie. ed doesn’t hate your guts.
And really, given the churlish foofaraw that surrounds it, ed actually works pretty well. It has an insert (and append) mode and a command mode, a lot like vim.
And it can do search and replace sequences, like emacs. And load and save by file name, like Notepad. And filter text, sort of like grep. And explain its cryptic “?” error messages. And a lot of other things too.
I don’t count myself as an ed expert. But I think it’s fair to say that most of the basic functions you would look for in any text editor are present in ed. They might be a little more cryptic, but no less functional.
If you want — or need — to get to know ed, I’d start on the linuxquestions.org wiki, which does a good job setting up your basics, and the man page for ed, which handles some more complicated functions.
Get through that, and you’ll realize ed really doesn’t hate anybody. It just takes a little getting to know it. 😉