Linux中几个正则表达式的用法
开源Linux
长按二维码加关注~

正则表达式就是用于匹配每行输入的一种模式,模式是指一串字符序列。拥有强大的字符搜索功能。也非常方便的搜索过滤出我们想要的内容。





cat /etc/passwd |egrep "^(root|A8)" |cut -d: -f1,3

echo /etc/rc.d/init.d/functions | egrep "[a-z]$"

echo /etc/rc.d/init.d/functions | egrep "/.*/"








来自:https://www.linuxmi.com/linux-zhengzebiaodashi.html
- End - 关注「开源Linux」加星标,提升IT技能
评论