find . -type f -exec sed -i "s/std=c++11/std=c++14/g" {} \;

搜索当前目录下的文件,把std=c++11替换成std=c++14,注意{}\之间有个空格。

全词替换

$ echo "bar embarassment" | sed "s/\bbar\b/no bar/g"
no bar embarassment

\b in regular expressions match word boundaries (i.e. the location between the first word character and non-word character):

相关文章:

  • 2021-09-23
  • 2021-12-09
  • 2022-01-07
  • 2021-10-11
  • 2022-12-23
  • 2021-11-05
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-06-08
  • 2021-12-13
  • 2021-05-17
相关资源
相似解决方案