作者:tacy lee
經(jīng)常,我們?cè)趩?dòng)應(yīng)用的時(shí)候發(fā)現(xiàn)系統(tǒng)需要的端口被別的程序占用,如何知道誰(shuí)占有了我們需要的端口,很多人都比較頭疼,下面就介紹一種非常簡(jiǎn)單的方法,希望對(duì)大家有用
假如我們需要確定誰(shuí)占用了我們的9050端口
1、Windows平臺(tái)
在windows命令行窗口下執(zhí)行:
C:\>netstat -aon|findstr "9050"
TCP 127.0.0.1:9050 0.0.0.0:0 LISTENING 2016
看到了嗎,端口被進(jìn)程號(hào)為2016的進(jìn)程占用,繼續(xù)執(zhí)行下面命令:
C:\>tasklist|findstr "2016"
tor.exe 2016 Console 0 16,064 K
很清楚吧,tor占用了你的端口
2、AIX
$netstat -Aan|grep 30542
f10000f303321b58 tcp4 0 0 *.30542 *.* LISTEN
$rmsock f10000f303321b58 tcpcb
The socket 0x3321800 is being held by proccess 692476 (db2sysc).
這個(gè)我就不解釋了
3、Linux
$netstat -pan|grep 2809
tcp 0 0 0.0.0.0:2809 0.0.0.0:* LISTEN 9493/java
del.icio.us Tags:
aix,
windows,
tips