method1
1 | sed -i "s/oldString/newString/g" `grep oldString -rl /path` |
method2
1 | grep oldString -rl /path | xargssed -i "s/oldString/newString/g" |
也可以在grep子句中添加过滤,如:【grep oss_room_v2 -rl /home/hadoop/nisj/automationDemand/idfaQuery/*.py】
写在最后
欢迎大家关注鄙人的公众号【麦田里的守望者zhg】,让我们一起成长,谢谢。
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment