1. netstat -Aan | grep -i listen | grep <port number>
比如查找25999被哪个占用
# netstat -Aan | grep -i listen | grep 25999
71107de4 tcp4 0 0 *.25999 *.* LISTEN
2. 使用rmsock <addr PCB> tcpcb ,别被这个命令吓倒,其实不是删除sock的。参数就是第一步返回的那个十六进制地址。
# rmsock 71107de4 tcpcb
The socket 0x71107c00 is being held by proccess 49546 (sms_access_agent).
The socket 0x71107c00 is being held by proccess 49546 (sms_access_agent).
括弧写的就是进程名。