0
点赞
收藏
分享

微信扫一扫

shell正则匹配ip(学习shell笔记七)

老榆 2022-07-27 阅读 52


shell正则匹配ip(学习shell笔记七)_vim

[root@localhost ~]# vim test.txt


shell正则匹配ip(学习shell笔记七)_vim_02



2014-08-17
20140907
14 03 22



192.168.1.2
121.168.2.3

123-212-2-3

[root@localhost ~]# grep "[0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}" test.txt
192.168.1.2
121.168.2.3

[root@localhost ~]# grep "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" test.txt
192.168.1.2
121.168.2.3

举报

相关推荐

0 条评论