|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
功能实在太强了,在配合exec参数或者通过管道重定向到xargs命令和grep命令,可以完成非常复杂的操作,如果同样的操作用图形界面的工具来完成,恐怕要多花十几陪的时间。
剖析:netstat-an检察到大批的80端口历程僵逝世,重启tomcat.tomcat启动失利,网页仍然没法翻开.
中断tomcat历程shutdown.sh,中断tomcat后telnet127.0.0.180,发明80端口仍然可用。netstat-an|grep80检察发明有很多80端口历程在内里,利用killpid命令停止历程,无用。利用lsof-i:80|grep-v"PID"|awk{print"kill-9",$2}命令后一切80端口历程删除。从头启动tomcat,体系一般运转。不外为何tomcat在封闭时却不克不及将80端口的历程一并封闭的缘故原由必要剖析一下。
[root@gzcourtbin]#netstat-an|grep80
tcp00::ffff:127.0.0.1:8005:::*LIST
EN
tcp00:::8009:::*LIST
EN
tcp00:::80:::*LIST
EN
tcp00:::8080:::*LIST
EN
tcp00::ffff:172.16.1.153:80::ffff:202.160.179.12:36057TIME
_WAIT
tcp00::ffff:172.16.1.153:80::ffff:202.160.178.15:39176TIME
_WAIT
tcp00::ffff:172.16.1.153:80::ffff:218.20.57.173:55001ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:218.20.57.173:3516ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:218.20.57.173:55037ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:218.20.57.173:3518ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:61.135.162.208:57893TIME
_WAIT
tcp00::ffff:172.16.1.153:80::ffff:210.72.4.122:39196ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:59.32.124.136:22529ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:218.20.57.173:55222ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:218.20.57.173:3510ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:59.32.124.136:22530ESTA
BLISHED
tcp00::ffff:172.16.1.153:80::ffff:210.72.4.122:39198ESTA
BLISHED
unix3[]STREAMCONNECTED6880/tmp/.X11-unix/X0
#lsof-i:80|grep-v"PID"|awk{print"kill-9",$2}|sh
以上剧本能够扫除80端口的历程
</p>
在这里你会学到更多的知识,学习linux,更要学习一种geek的精神,python之禅中也说过:以总结分享为荣,以跪求其解为耻; |
|