How do you find and replace a string in multiple files in Linux?

How do you find and replace a string in multiple files in Linux?
Answer
sed
  1. i — replace in file. Remove it for a dry run mode;
  2. s/search/replace/g — this is the substitution command. The s stands for substitute (i.e. replace), the g instructs the command to replace all occurrences.
 

Tìm kiếm

Back
Top