Enough Ed to Survive on the FreeBSD, Linux, NetBSD, and OpenBSD Command Line.

Search and replace

Search and replace functionality in ed(1) works in to mode: single replacement and global replacement. The following example shows how to replace the first occurrence of the given string:

Switch to command mode.

Type s/

Type the string you are looking for.

Type /

Type the replacement string.

Type /

Hit the Enter/Return key.

Example:

:: To read the rest of this book for free, log in to Facebook.

:: next :: Copy the current line
:: Table of Contents
:: previous :: Search for a string

 


 

$4.99

Get it on Kindle

(Amazon.com may add a delivery charge.)

FREE

Read this book for free on Facebook

© Copyright 2003–2017 Jacek Artymiak. All rights reserved.