1
sed -i "s/oldstring/newstring/g" \`grep oldstring -rl yourdir\`
例如:替换/resources下所有文件中的www.admin99.net为admin99.net
sed -i "s/www.admin99.net/admin99.net/g" \`grep www.admin99.net -rl /home\`
这个` 符号是F1下边,tab键上边,数字1左边的那个,不是单引号 ’
original link: http://Apiaceae.github.io/blog/2011/12/04/ubuntue-sed-commands/ written by Hooker posted at http://Apiaceae.github.io