Find and replace content in 100 lines

Mike Clarke jmc-freebsd2 at
Fri May 1 21:29:51 UTC 2015

On Fri, 1 May 2015 16:20:07 -0400
Alex Merritt <merritt.alex at> wrote:

> You want sed with the search/replace feature, generally:
> sed s/regular expression/replacement/flags
> like so
> 's:"../../../arch1/arch14":"../../../../../../foo/foo2/foo3/arch1/arch14":g'
> input.html

Although that would almost certainly work OK in the OP's case  it would
be safer to use:


 otherwise if there was  something like "../../d1/arch1/arch14" it would
 become "../../../../../../foo/foo2/foo3/arch1/arch14" which is probably
 not what would be intended.

Mike Clarke

More information about the freebsd-questions mailing list