sed,awk
bobtthp
云原生爱好者
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
sed,awk多条件匹配
Oct 24 12:00:01 bob systemd: Started Session 49 of user root.Oct 24 12:00:01 bob systemd: Starting Session 49 of user root.Oct 24 12:01:02 bob systemd: Started Session 50 of user root.Oct原创 2017-10-24 12:29:06 · 2954 阅读 · 0 评论 -
sed、awk截取日志
awk ‘/字符串1/{a=1}a{b=b?b"\n"$0:$0;if(b~/字符串2/){print b;b=""}}’ filesed -n ‘/字符串1/{p;:1;n;:2;/字符串2/{p;b1};N;b2}’ fileawk ‘/字符串1/{a=1}a{b=b?b"\n"$0:$0;if(b~/字符串2/){print b;b=""}}’ filesed -n ‘/字符串1...原创 2018-09-22 19:12:46 · 2044 阅读 · 0 评论
分享