awk奇数行awk偶数行 sed奇偶数行非常简单,awk也不算麻烦 root@mail ~ # cat a 1 2 3 4 # 输出奇数行 root@mail ~ # awk '{print;getline}' a 1 3 # 输出偶数行 root@mail ~ # awk '{if((getline)>0){print}}' a 2 4 Tags: awk偶数行, awk奇数行, awk详解 Read more articles Previous Postawk语句块 Next Postawk数组awk详解 You Might Also Like nginx日志切割脚本 September 8, 2015 HTTPS域名证书有效期校验 November 1, 2016 sed合并偶数行到上一行 May 30, 2015