查看端口9010是否已占用
方式一:
[dev_ydzj_1@localhost logs]$ lsof -i:9010
-bash: lsof: command not found
[dev_ydzj_1@localhost logs]$ whereis lsof
lsof: /usr/sbin/lsof /usr/share/man/man8/lsof.8.gz
[dev_ydzj_1@localhost logs]$ /usr/sbin/lsof -i:9010
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
java 18428 dev_ydzj_1 54u IPv6 405909367 TCP *:9010 (LISTEN)
[dev_ydzj_1@localhost logs]$
发现端口9010已被PID为18428线程占用
方式二:
[dev_ydzj_1@localhost ~]$ netstat -an | grep 9010
tcp 0 0 :::9010 :::* LISTEN
[url=http://www.cnblogs.com/benio/archive/2010/09/15/1826728.html]Linux查看程序端口占用情况[/url]
[url=http://jingyan.baidu.com/article/a378c96080e940b328283024.html]windows7如何查看端口被占用[/url]
win7下查看被占用端口
[img]http://dl2.iteye.com/upload/attachment/0103/3128/6da47a80-1be8-38af-80e8-7e0450e56938.png[/img]
结束被占用端口的进程
[img]http://dl2.iteye.com/upload/attachment/0108/3871/8ad68820-966d-3fd1-9efa-67c115038283.png[/img]
[url=http://hw1287789687.iteye.com/blog/2269708]通过命令名称查询进程id[/url]
方式一:
[dev_ydzj_1@localhost logs]$ lsof -i:9010
-bash: lsof: command not found
[dev_ydzj_1@localhost logs]$ whereis lsof
lsof: /usr/sbin/lsof /usr/share/man/man8/lsof.8.gz
[dev_ydzj_1@localhost logs]$ /usr/sbin/lsof -i:9010
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
java 18428 dev_ydzj_1 54u IPv6 405909367 TCP *:9010 (LISTEN)
[dev_ydzj_1@localhost logs]$
发现端口9010已被PID为18428线程占用
方式二:
[dev_ydzj_1@localhost ~]$ netstat -an | grep 9010
tcp 0 0 :::9010 :::* LISTEN
[url=http://www.cnblogs.com/benio/archive/2010/09/15/1826728.html]Linux查看程序端口占用情况[/url]
[url=http://jingyan.baidu.com/article/a378c96080e940b328283024.html]windows7如何查看端口被占用[/url]
win7下查看被占用端口
[img]http://dl2.iteye.com/upload/attachment/0103/3128/6da47a80-1be8-38af-80e8-7e0450e56938.png[/img]
结束被占用端口的进程
[img]http://dl2.iteye.com/upload/attachment/0108/3871/8ad68820-966d-3fd1-9efa-67c115038283.png[/img]
[url=http://hw1287789687.iteye.com/blog/2269708]通过命令名称查询进程id[/url]