Windows下查看某端口号被哪个进程占用

  1. <pre class="html" name="code"> </pre>  
  2. <pre></pre>  
  3. <p>整理自网络,备查。</p>  
  4. <p>首先查看端口号被哪个进程占用,用netstat -ano即可查出,不过-o只能显示进程的pid</p>  
  5. <p>以端口号1521为例:</p>  
  6. <pre class="plain" name="code">C:\Documents and Settings\Administrator>netstat -ano | find "1521"  
  7.   TCP    0.0.0.0:1521           0.0.0.0:0              LISTENING       212  
  8.   TCP    10.0.5.215:1049        10.0.5.215:1521        ESTABLISHED     276  
  9.   TCP    10.0.5.215:1050        10.0.5.215:1521        ESTABLISHED     372  
  10.   TCP    10.0.5.215:1051        10.0.5.215:1521        ESTABLISHED     400  
  11.   TCP    10.0.5.215:1052        10.0.5.215:1521        ESTABLISHED     388  
  12.   TCP    10.0.5.215:1521        10.0.5.215:1049        ESTABLISHED     212  
  13.   TCP    10.0.5.215:1521        10.0.5.215:1050        ESTABLISHED     212  
  14.   TCP    10.0.5.215:1521        10.0.5.215:1051        ESTABLISHED     212  
  15.   TCP    10.0.5.215:1521        10.0.5.215:1052        ESTABLISHED     212  
  16.   
  17. </pre>  
  18. <p>再查看276、372、400、388对应的进程详细信息</p>  
  19. <pre class="plain" name="code">C:\Documents and Settings\Administrator>tasklist | findstr "212"  
  20. TNSLSNR.EXE                    212 Console                    0      6,704 K  
  21.   
  22. C:\Documents and Settings\Administrator>tasklist | findstr "276"  
  23. jqs.exe                       1276 Console                    0      1,812 K  
  24. oracle.exe                     276 Console                    0    156,192 K  
  25. oscar.exe                     5876 Console                    0    105,276 K  
  26.   
  27. C:\Documents and Settings\Administrator>tasklist | findstr "372"  
  28. oracle.exe                     372 Console                    0    118,856 K  
  29. java.exe                      4696 Console                    0     91,372 K  
  30.   
  31. C:\Documents and Settings\Administrator>tasklist | findstr "388"  
  32. msdtc.exe                      660 Console                    0      4,388 K  
  33. oracle.exe                     388 Console                    0    118,180 K  
  34. alg.exe                       3884 Console                    0      2,948 K</pre>  
  35. <p><br>  
  36. 同样,查看某个进程占用哪些端口号,也可以使用上述方法。</p>  
  37. <p>获取进程的pid</p>  
  38. <pre class="plain" name="code">C:\Documents and Settings\Administrator>netstat -ano | find "276"  
  39.   TCP    0.0.0.0:1047           0.0.0.0:0              LISTENING       276  
  40.   TCP    10.0.5.215:1049        10.0.5.215:1521        ESTABLISHED     276  
  41.   TCP    127.0.0.1:5152         0.0.0.0:0              LISTENING       1276</pre>  
  42. <p>也可以通过任务管理器,选择查看->选择列->PID选项查看程序的pid</p>  
  43. <p>查看对应pid进程占用的端口号</p>  
  44. <pre class="plain" name="code">C:\Documents and Settings\Administrator>netstat -ano | find "276"  
  45.   TCP    0.0.0.0:1047           0.0.0.0:0              LISTENING       276  
  46.   TCP    10.0.5.215:1049        10.0.5.215:1521        ESTABLISHED     276  
  47.   TCP    127.0.0.1:5152         0.0.0.0:0              LISTENING       1276</pre>  
  48. <p><br>  
  49.  </p>  
  50. <pre></pre>  

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值