用此命令替换字符串

时间:2012-11-24 00:41:01

标签: bash sed grep

find /home -iname ".htaccess" -exec grep -l "FollowSymLinks" {} \;

我是否将-SED添加到-exec中,以便我可以执行查找和替换:

 +FollowSymLinks to +SymLinksIfOwnerMatch

1 个答案:

答案 0 :(得分:2)

你可以这样做:

find /home -iname ".htaccess" -exec sed -i "s/FollowSymLinks/SymLinksIfOwnerMatch/g" {} \;