How to replace a string in multiple files in linux command line?

Sometimes there are surprises even for long-time developers and linux users. One of these is the commandline tool rpl: , see https://manpages.ubuntu.com/manpages/jammy/man1/rpl.1.html

You don’t have to struggle with tools like sed in combination with find or grep. Just use a single tool! For example:

rpl -v foo bar '**/*.txt'

It replaces “foo” with “bar” in all .txt files recursively.

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: