1

From a given folder, I want to search recursively accross all subfolders searching for files with name file.txt replacing all occurences of Foo -case sensitive- with Bar.

Which is the simplest way of achieving this with basic scripting (Bash / sed / grep / find...).

M.E.
  • 4,635
  • 3
  • 33
  • 96

1 Answers1

1

find + sed solution:

find . -type f -name "file.txt" -exec sed -i 's/Foo/Bar/g' {} \;
RomanPerekhrest
  • 75,918
  • 4
  • 51
  • 91