find命令配合sed命令使用

find /link -type -name "*.sh" |xargs sed -i 's#link#hello#g'

1.查找当前目录下所有以txt文件中包含123的数字都替换成5678

find ./ -name "*.txt" -exec  grep "123" {} \; -exec sed -i 's/123/5678/g' {} \;

 

posted @ 2021-06-11 14:07  技术颜良  阅读(535)  评论(0编辑  收藏  举报