I have a project that contains one file a.txt
that contains the text hello
, and a folder called b
that contains a file c.txt
that also contains the text hello
. I want to run a bash command that will replace these two instances of hello
with goodbye
, identical to VSCode's search-and-replace functionality.
I've tried sed -i '.bak' 's/hello/goodbye/g' *
, but it gives me the error sed: folder: in-place editing only works for regular files
.
How should I approach this? I'm using MacOS.