How to grep and replace

后端 未结 9 1582
囚心锁ツ
囚心锁ツ 2020-11-27 08:47

I need to recursively search for a specified string within all files and subdirectories within a directory and replace this string with another string.

I know that t

9条回答
  •  抹茶落季
    2020-11-27 09:25

    Another option is to use find and then pass it through sed.

    find /path/to/files -type f -exec sed -i 's/oldstring/new string/g' {} \;
    

提交回复
热议问题