首页 > 其他 > 详细

grep' \b\b'

时间:2016-05-24 16:48:30      阅读:171      评论:0      收藏:0      [点我收藏+]
\b单词锁定符,如: ‘\bgrep\b‘只匹配grep

 

[root@86 ttf-arphic-uming-0.0.20050501]# cat /proc/diskstats
   1       0 ram0 0 0 0 0 0 0 0 0 0 0 0
   1       1 ram1 0 0 0 0 0 0 0 0 0 0 0
   1       2 ram2 0 0 0 0 0 0 0 0 0 0 0
   1       3 ram3 0 0 0 0 0 0 0 0 0 0 0
   1       4 ram4 0 0 0 0 0 0 0 0 0 0 0
   1       5 ram5 0 0 0 0 0 0 0 0 0 0 0
   1       6 ram6 0 0 0 0 0 0 0 0 0 0 0
   1       7 ram7 0 0 0 0 0 0 0 0 0 0 0
   1       8 ram8 0 0 0 0 0 0 0 0 0 0 0
   1       9 ram9 0 0 0 0 0 0 0 0 0 0 0
   1      10 ram10 0 0 0 0 0 0 0 0 0 0 0
   1      11 ram11 0 0 0 0 0 0 0 0 0 0 0
   1      12 ram12 0 0 0 0 0 0 0 0 0 0 0
   1      13 ram13 0 0 0 0 0 0 0 0 0 0 0
   1      14 ram14 0 0 0 0 0 0 0 0 0 0 0
   1      15 ram15 0 0 0 0 0 0 0 0 0 0 0
   7       0 loop0 0 0 0 0 0 0 0 0 0 0 0
   7       1 loop1 0 0 0 0 0 0 0 0 0 0 0
   7       2 loop2 0 0 0 0 0 0 0 0 0 0 0
   7       3 loop3 0 0 0 0 0 0 0 0 0 0 0
   7       4 loop4 0 0 0 0 0 0 0 0 0 0 0
   7       5 loop5 0 0 0 0 0 0 0 0 0 0 0
   7       6 loop6 0 0 0 0 0 0 0 0 0 0 0
   7       7 loop7 0 0 0 0 0 0 0 0 0 0 0
 202       0 xvda 82523 258 2428188 331412 316952 778724 8778096 9298675 0 325192 9630429
 202       1 xvda1 82359 258 2426876 331278 316952 778724 8778096 9298675 0 325058 9630295

 

[root@86 ttf-arphic-uming-0.0.20050501]# cat /proc/diskstats|grep -E "\bsd[a-z]\b|\bxvd[a-z]\b"
 202       0 xvda 82571 258 2428572 331629 319518 779539 8805144 9310801 0 327449 9642771

 

[root@86 ttf-arphic-uming-0.0.20050501]# cat /proc/diskstats|grep -E "\bsd[a-z]\b|\bxvd[a-z]\b"|awk ‘{print $3}‘

 

grep' \b\b'

原文:http://www.cnblogs.com/bass6/p/5523654.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!