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,955
  • 4
  • 49
  • 128

1 Answers1

1

find + sed solution:

find . -type f -name "file.txt" -exec sed -i 's/Foo/Bar/g' {} \;
RomanPerekhrest
  • 88,541
  • 4
  • 65
  • 105