LINUX命令批量替换文件中的字符串

sed -i "s/abcd/1234/g" `grep abcd -rl /home/data`

 

find /data/web  -type f -exec  sed -i 's#abcd#1234#' {} \;

 

find . -type f |xargs grep 'test'

find ./abroad -name "config.inc.php" -exec sed -i  's#database#localhost#' {} \;

find ./abroad -name "config.inc.php" -exec sed -i  's#database#localhost#g' {} \;

你可能感兴趣的:(linux命令)