CentOS 6.X 查看端口占用并杀掉
[p=26, 2, left]查看所有网络端口 netstat -an[/p][p=26, 2, left][root@xxxxx~]# netstat -anActive Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8006 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
[/p]
[p=26, 2, left]查看端口具体被那个进程占用 lsof -i :3690[/p][p=26, 2, left][root@xxxxxx~]# lsof -i :3690
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
svnserve 8533 root 3u IPv4 42704 0t0 TCP *:svn (LISTEN)
[/p][p=26, 2, left]
[/p][p=26, 2, left][color=#333333][font=Arial][size=14px]再使用以下命令查看详细信息:[/size][/font][/color][/p][p=26, 2, left][font=Arial][size=14px] ps -aux | grep 8533
[/size][/font][/p][p=26, 2, left][font=Arial][size=14px][root@iZbp1g3u73g9nybvafuwc6Z ~]# ps -aux | grep 8533
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 8533 0.0 0.0 156996 888 ? Ss 10:20 0:00 svnserve -d -r /shiyu/
root 8648 0.0 0.0 103256 840 pts/0 S+ 10:31 0:00 grep 8533
[/size][/font][/p][p=26, 2, left][font=Arial][size=14px]最后kill-9 pid[/size][/font][/p][p=26, 2, left][font=Arial][size=14px]kill -9 8533[/size][/font][/p]
页:
[1]