shell编程系列13--文本处理三剑客之sed利用sed追加文件内容 追加用法总结: .a 在匹配行后面追加 .i 在匹配行前面追加 .r 将文件内容追加到匹配行后面 .w 将匹配行写入指定文件 追加用法示例详解: .a ().passwd文件第10行后面追加"Add Line Behind" sed -i '10aAdd Line Behind' passwd ().passwd文件第10行到第20行,每一行后面都追加"Test Line Behind" sed
追加用法总结 1.a 在匹配行后面追加 2.i 在匹配行前面追加 3.r 将文件内容追加到匹配行后面 4.w 将匹配行写入指定文件 在匹配行后面追加 a passwd文件第10行后面追加"Add Line Behind" sed -i '10aAdd Line Behind' passwd passwd文件第10行到第20行,每一行后面都追加"Test Line Behind" sed -i '10,20a Test Line Behind' passwd pass
1. Sed的help 鸟哥说的 学东西 先看 help 先看man 再google 不好FQ再百度.. Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]... -n, --quiet, --silent suppress automatic printing of pattern space -e script, --expression=script add the script to the comma