天天看点

linux sed用法awk查找awd调用系统命令

sed -i '88 r b.file' a.file

在a.file的88行插入b.file

awk '1;NR==88{system("cat b.file")}' a.file > a.file

awk查找

awk '/neon-0.29.6.tar.gz/{print $1}' a.sh

sed -i '/regex/ r b.txt' a.txt # regex是正则表达式

awk '/target/{system("cat b.file")}' a.file > c.file

awd调用系统命令

awk 'NR==2{system("cat anaconda-ks.cfg")}' a.sh

sed插入文件

" r a.txt"

sed追加

sed -i "/aaa/a\bbbb" file

前面

sed -i "/aaa/i\bbb" file

sed -n "/a/,/b/" file

继续阅读