linux 中sed命令同时对多个字符进行替换

 

001、

[root@PC1 test]# ls
a.txt
[root@PC1 test]# cat a.txt
d t d
e k c
z c e
e f t
[root@PC1 test]# sed 's/d/9/g' a.txt     ## 将d替换为9
9 t 9
e k c
z c e
e f t
[root@PC1 test]# sed 's/d\|e/9/g' a.txt     ## 同时讲d和e替换为9
9 t 9
9 k c
z c 9
9 f t

 

posted @ 2022-12-08 11:59  小鲨鱼2018  阅读(1011)  评论(0编辑  收藏  举报