作者lupin513 (萤幕,你不要走~~)
看板FreeBSD
标题[问题] 请教sed指令使用
时间Thu Jun 2 16:54:32 2011
请教各位大大,
最近自家的SERVER一直被攻击,
想统计一下,并且整理资料,
在网路上看到这篇文章。
http://chejen-l.blogspot.com/2011_05_01_archive.html
grep 'login error' /var/log/openwebmail.log > auth_error.log
sed ' s/^.* (\[0-9]*\.[0-9]*.\[0-9]*\.[0-9]*\).*/\1/g 'auth_error.log > ip_list.txt
sort ip_list.txt > sort_ip_list.txt
uniq -c sort_ip_list.txt
但是在我的FreeBSD中,第二行指令一直无法成功。
显示的错误讯息为:sed: 1: "s/^.* ([0-9]*\.[0-9]*.\ ...": RE error: parentheses not balanced
不知道是我的系统问题,还是我复制的指令有问题呢?
我的FreeBSD 是6.1,暂时没打算升级,请大大指导,谢谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.69.120.76