How to use _ed_ text editor

written by Admin


Posted on 2013-02-07


Problem

Over a serial console or in embedded devices I cannot edit text files using vi or emacs, but only using ed. It´s a bit obscure, how can I do?

Solution

First start editing session:
#ed filename

To print file contents type ,p
To print and point to next line type +
To print and point to previous line type -
To delete current line type d
To insert text in current position type a and conclude insertion with a dot alone on a line
To search for a text type /text/
To replace some text type s/search/replace/
To save type w
...then exit with q

Feedback


Comments

Leave a Comment:

Search

Welcome

We need collaboration and a real boost from our community: write us an email for every trick you find!

This website is a sysadmin swiss-knife for every-day Windows, Linux and Mac administration and troubleshooting

Our database grows if YOU send us your tips and trick as soon as you find them every day!