Imagine you have couple of files: host1.cfg, host2.cfg, host3.cfg and you want to replace “hostname1”, “hostname2”, “hostname3” in each file at once to something like “hostname1-backup”. Here’s simple sed oneliner which will do that:

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.

Post Navigation