sed行首行尾 & 在s替换命令里面,表前面//里面匹配到的 # 在每行的头添加字符,比如"HEAD",命令如下: sed 's/^/HEAD&/g' test.file # 在每行的行尾添加字符,比如“TAIL”,命令如下: sed 's/$/&TAIL/g' test.file Tags: sed使用, sed详解 Read more articles Previous Postsed删除关键字的上一行 Next Postufw中转规则添加 You Might Also Like bm灰度更新shell脚本二 May 6, 2019 bm检测打开关闭cdn July 17, 2019 sed合并行 August 28, 2015