Windows CMD netstat输出一行


0

使用-aonb选项时,Netstat的输出将换行。我不能使用FIND在一行中过滤输出。

增加屏幕缓冲区宽度和窗口宽度无济于事。该命令仍然会换行。与powershell相同。

    netstat -aonb
    Active Connections

      Proto  Local Address          Foreign Address        State           PID
      TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1304
      RpcSs
     [svchost.exe]
      TCP    0.0.0.0:27036          0.0.0.0:0              LISTENING       11096
     [Steam.exe]
      TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       1680
      Schedule
     [svchost.exe]
      TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       1632
      EventLog
     [svchost.exe]

我想使用FIND命令来过滤进程使用的端口,但是由于它会断行,所以我无法对其进行过滤。

    netstat -aonb | FIND "svchost.exe"
    [svchost.exe]

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.