How to replace string in files

From vpsget wiki
Revision as of 00:49, 21 July 2020 by Ndi (talk | contribs) (Created page with "Here is the example of how to replace string for another string in batch of files. Here is the example how to change ip address to another in all apache virtual hosts conf fi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here is the example of how to replace string for another string in batch of files. Here is the example how to change ip address to another in all apache virtual hosts conf files:

sed -i -- 's/111.11.51.11/ 23.18.99.9/g' /etc/apache2/sites-available/*