Microsoft
Software
Hardware
Network
Question : How do I search recursively for a string and replace all instances of it with another in Linux?
I have an installation of a PHP-based e-commerce solution and I need to recursively search through its files for a a string "DomainName.com_2" and replace each instance of it with "DomainName.com".
While I have basic Linux command line experience, I'm strong with advance uses of grep, sed, awk, regular expressions, etc.
I would prefer a simplistic approach over an highly optimized one, but ultimately, whatever works! =P
Thanks for your help!
Answer : How do I search recursively for a string and replace all instances of it with another in Linux?
grep -lr "DomainName.com_2" /path/to/files/* | xargs -i sed -i 's/DomainName.com_2/Domain
Name.com/g
' {}
Random Solutions
Symantec update of their AV files
Cloning X300 from Symantec Ghost 8.3
Exchange 2007 and Exchange 2003 OWA question
How to delete files based on their age in day
Question about the setup of DFS-R and multiple namespace servers
Changing Computer Name in Virtual PC
Problem accessing global IP that are local servers within the optional port of my Firebox
How do i send a copy of a non-delivery report to Postmaster with exchange 2007
Replication rejection of 2 DC's
Solaris No Display with IBM KVM