sed 指定范围内匹配上就替换 先指定范围,再对匹配上的内容进行替换 sed -i '5,10 s#hello#world#' test.txt 螃蟹在剥我的壳,笔记本在写我,漫天的我落在枫叶上雪花上,而你在想我。 --章怀柔