Shell/Bash: linux replace string in files recursively Example

By

Shell/Bash Example: This is the "linux replace string in files recursively" Example. compiled from many sources on the internet by SimpleTutorials.org

linux replace string in files recursively

find . -type f -name "*.txt" -exec sed -i'' -e 's/foo/bar/g' {} +

linux replace string in all files

sed -i 's/old-text/new-text/g' input.txt

linux replace string in files recursively

find /home/www \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/subdomainA\.example\.com/subdomainB.example.com/g'



* Summary: This "linux replace string in files recursively" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others