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/bar/no bar/g"
no bar embarassment
in regular expressions match word boundaries (i.e. the location between the first word character and non-word character):