摘要:
按esc进入命令模式 1.替换 :%s/str1/str2/g 替换每一行中所有str1为str2 :s/str1/str2/g 替换当前行中所有str1为str2 :n1,n2s/str1/str2/g 替换n1行到n2行中所有str1为str2 备注:去掉/g即表示只替换匹配到的第一个str1为 阅读全文
摘要:
一、 awk 命令格式: awk ‘BEGIN{commands} pattern {commands} END{commands}’file 工作方式: 1.执行BEGIN{commands}语句块中语句,可选的语句块 2.从文件或者stdin中读取一行,然后执行{commands},重复这个过程 阅读全文