Replace text recursively

I’m in the process of moving from my gogs instance on git.icod.de to my gitea instance on code.icod.de
In this process I’m migrating countless packages manually. It’s quite a lot of work.

Often I need to replace “git.icod.de’ with ‘code.icod.de’

To do this on a Linux machine I use the following 1-liner:

In this example I’m replacing git.icod.de/dalu/blogs with code.icod.de/dalu/blogs. Since sed uses regexp search I have to escape the . and /. I could’ve used ~ as delimiters. If I had the 1-liner would look like this:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.