Post

How to replace text in lots of file via sed and find

How to replace text in lots of file via sed and find

I have recently decided to change the way how my code blocks look like at this blog. This was rather straightforward change. I needed to exchange “bash" to "”.

Here is an easy way how this can be achieved via find and sed.

1
2
find content/english -type f -name '*.md' -exec sed -i '' -e 's|\`\`\`bash|\`\`\`|g' {} +
'
This post is licensed under CC BY 4.0 by the author.