codrut.pro
  • CV
  • Projects
  • Snippets
  • Tags
  • More

Replace string in all files with sed

May 9, 2021 One-minute read
linux • productivity • sed
find . -type f -exec sed -i 's/STRING GOES HERE/REPLACEMENT HERE/g' {} +

Make sure to escape brackets (\[\]):

find . -type f -exec sed -i 's|Click \[here\](/here/)!|Click HERE!|g' {} +