Skip to content

Instantly share code, notes, and snippets.

@wwwins
Created March 16, 2022 03:22
Show Gist options
  • Save wwwins/3ad0d1c8cfa3eaebf5a72b719f22e560 to your computer and use it in GitHub Desktop.
Save wwwins/3ad0d1c8cfa3eaebf5a72b719f22e560 to your computer and use it in GitHub Desktop.
Find and replace a string in multiple files
# Replace "4bk.aaa.com.tw" -> "bk.aaa.com.tw" in *.js|htm|html|css files
find www -type f \( -iname "*.js" -or -iname "*.htm" -or -iname "*.html" -or -iname "*.css" \) -exec sed -i '' 's/4bk.aaa.com.tw/bk.aaa.com.tw/g' {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment