过滤文件内电子邮箱和网站地址
过滤邮箱(只显示过滤文本):
#egrep -o ‘[A-Za-z0-9.][email protected][A-Za-z0-9.]+\.[a-zA-Z]{2,3}‘ file.txt
[email protected]
[email protected]
过滤网站地址:
#egrep -o ‘http://[A-Za-z0-9\-\.]+\.[a-zA-Z]{2,3}‘ file.txt
http://code.nagios.google.com
过滤IP地址:
egrep -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" file.txt
时间: 2025-01-11 12:50:50