Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm glad ed is there. I'm glad articles like this are there. But there is no way I'll have retained that article in the moment my terminal has borked and I actually need ed. I wish that something like this available in the man pages, or something like them, or at least referred to in them.

Because maybe I'm not clever enough but I don't find the man page articles to be very good introductions. As reminders of syntax and options and functionality they're great, but I don't find them useful as orientations to how the various utilities work. They are short on examples and demonstrations, which are often the quickest orientations to the basic operation of a tool.

The info tool is sometimes better but not so frequently I'm accustomed to using it. On Ubuntu 'info ed' actually looks pretty good from an example standpoint. But 'info awk' looks like a copy of the man page. And 'info vi' offers a discussion of the emacs vi emulator, about which vi enthusiasts can only mutter "well played".

It would be nice if there were a 'tutorial' command (or 'dontpanic' or 'towel') which gave a brief orientation to how these tools actually worked, with examples and demos, and then some lead into resources on the host (man pages, info, help available within the particular tool) and on the web and elsewhere.



Linux man pages are notoriously verbose, and often obtuse and incomplete, this is in great part due to the extra complexity of GNU tools and their preference for the infamous info documentation system.

OpenBSD has probably the best Unix manual pages:

http://www.openbsd.org/cgi-bin/man.cgi?query=ed

And Plan 9 has a manual that is a pleasure to read, this is helped in part because the commands themselves have been cleaned up and simplified in many cases:

http://man.cat-v.org/p9p/1/ed


I think instead of `verbose' you meant the opposite `terse.'


They're either the output of --help turned into -man macros or more noise than signal. Damn info!


I dream of a system with features such as iPython live doc, or Bret Victor's tangle. It seems an approachable goal nowadays.


Info pages are utterly useless--I don't think I've ever had anything useful from there. If I've screwed my system up so badly I need to use ed, even "man" might not necessarily work (these days GNU commands are just so damn clever). Best thing is usually to grab another computer or your smartphone and start Googling.


If you want an ed(1) tutorial why not try Brian Kernighan's original? http://nietzschegym.com/edtut.pdf


On many systems you should be able to unbork the terminal with 'reset' or 'tput reset'. Then you do not need ed ;)


That's only going to fix a few causes of borked-ness. If the remote system doesn't have a termcap for your terminal, reset doesn't do much. In that case, setting TERM=vt100 will probably help matters, unless you're on a really obscure terminal of some sort.


I think my underlying point is that it's fine to learn ed, but if the problem is that you are borking your terminal then there are actually ways around that. These days it should almost never happen that you are sitting around tolerating a broken terminal. This is not an efficient use of time. The actual modern use cases for ed are not very common. If you want to learn it just for kicks or because you think it's cool then that is another thing.


That last happened to me fairly recently, when a server was unable to mount /usr (where the termcap stuff lives) and I had to use ed to edit the RAID config files so that I could mount it. Fun times.


Ouch, more extreme than I was thinking. I've encountered systems that don't like screen or urxvt or what have you, but they still had vt100 and that's a useful subset of the termcap of most modern terminal emulators. If there's no /usr at all, that's certainly a stronger argument for ed!


I've used ed and other commands on headless systems more than once, back when networks weren't common. One has to be careful of typing and having a bell can be useful for reassurance; grep newthing foo && echo ^G.


My survival kit for linux man pages is "/" for search and then "n" until option is found.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: