Created
November 11, 2021 08:40
-
-
Save thomasschuiki/ecb0b528413132ad9112ccf3ae743ab2 to your computer and use it in GitHub Desktop.
Replace text in files with sed and find
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # replace <word> with <replace> in all files in current directory (creates backup files) | |
| sed -i.bak -- 's/<word>/<replace>/g' ./* | |
| # replace <word> with <replace> in certain files recursivly (creates backup files) | |
| find ./folder -type f -name "*.ext" -exec sed -i.bak -- 's/<word>/<replace>/g' {} + | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment