Linux sed正则匹配替换文本中所有数字

tech2025-11-14  5

语法 sed -re ‘s/匹配内容/替换内容/g’

显示匹配的数字 sed -n -re ‘s/[0-9].*/我已被替换/p’ 1.txt

替换 : 将n和p修改为i和g 效果:

最新回复(0)