Shell currently traversing under the .xml file extension and replace the contents of the file

1, shell find .xml file

find /home/esoon/test/external/ -type f -name '*.xml'

2, an alternative method

sed -i "s / 10.111.151.32: 5060 / 10.111.151.39: 5060 / g" [a] 10.111.151.32:5060 replaced 10.111.151.39:5060

3, Find and Replace

find /home/esoon/test/external/ -type f -name '*.xml'|xargs sed -i "s/10.111.151.32:5060/10.111.151.39:5060/g"

[Find / home / esoon / test / external / html directory of all files and the contents of the file 10.111.151.32:5060 replaced 10.111.151.39:5060]

Guess you like

Origin www.cnblogs.com/it-davidchen/p/11321085.html