by
97 9

sh: recursive find and replace

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/47453/sh--recursive-find-and-replace?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
# find "X_ABC_IPv4Address" into every *.xml file located under /tmp/test, and replace it with X_ABC_ACLRule. # 2>/dev/null avoid error prints when for istance, a symbolink link is found under a subdir grep -lr X_ABC_IPv4Address /tmp/test --include *.xml 2>/dev/null | xargs sed -i "s|X_ABC_IPv4Address|X_ABC_ACLRule|g"
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus