Emacs 27.1
Linux Mint 21
I have text modifyNetwork in 50 files in differents folders. I need to replace them by text performCommand.
What is the easiest way to replace text in all files in all subfolders?
If you regularly edit a certain group of files, you can define them as a fileset. This lets you perform certain operations, such as visiting,
query-replace
, and shell commands on all the files at once.
That's what you need.
If all your files belong to a single project, then project-query-replace-regexp
is a solution. If they do not, you can use sed
.
sed -i s/modifyNetwork/performCommand/
may do the job. @a_subscriber
Commented
Jun 17, 2023 at 20:19
multi-occur
is a possibility. You will need a way to specify all the files that you want to operate on.
sed
as a comment in the answer indicates). But that's hardly an Emacs problem and therefore unsuitable for Emacs SE.