Replacement of the contents of the file
1. If it's just a string in a file, you can use g/192.168.254.2/s/192.168.254.2/10.2.2.3/g
The explanation is as follows: Gram 192.168.254.2 indicates that the string 192.168.254.2 is searched in full text, and the string found is followed by
Operation. The string will be replaced by the string substitution in 192.168.254.2 and 10.2.2.3, and the last g indicates the whole substitution.
2. Another method is more worth learning. Sed's myfile 192.168.254.2 Citrus 10.2.2.3 Universe GI. Note two points: first, 10.2.2.3 is followed by a slash, and then-I writes the result directly back to myfile.