Find & Replace in multiple files
Today I wanted to change all my .emacs.d/
files in one go. I’ve previously
prefixed my functions with bj/
but find that too hard to type fast. bj:
seems to be an easier alternative. Not wanting to manually edit all those files
I looked into grep
and sed
to help me out!
First step: what are the files that have bj/
in it?
Second step: replace the file contents which match bj/
with bj:
-i
makes file.el
to serve as output as well.
Third step: putting it all together.
Nice work!
PS. It took me about the same amount of time to write this post and to commit this change.