grep和egrep

时间:2014-08-25 14:40:44   收藏:0   阅读:190

grep  nobody /etc/passwd 显示/etc/passwd中带有nobody字样的行,区分大小写

grep  -i nobody /etc/passwd 现实/etc/passwd中带有nobody字样的行,不区分大小写

grep -v nobody /etc/passwd 不包含nobody的字样的行

grep -n nobody /etc/passwd 显示包含nobody的行并显示行号

egrep 是扩充功能的grep

egrep ‘2|5‘ test 列出含有2或者5的行

egrep ‘33(2|5)‘ test 列出包含33,而且后面跟的是2或5的行

 

原文:http://www.cnblogs.com/lehao/p/3934804.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!