Netstat output breaks line when -aonb options are used. I can't use FIND to filter the output in one line.

Increasing Screen buffer width and Window width doesn't help. The command still breaks into new lines. Its the same with powershell.

    netstat -aonb
    Active Connections

      Proto  Local Address          Foreign Address        State           PID
      TCP                LISTENING       1304
      TCP              LISTENING       11096
      TCP              LISTENING       1680
      TCP              LISTENING       1632

I want to use FIND command to filter the ports used by process, but since it break lines, I could not filter it.

    netstat -aonb | FIND "svchost.exe"

If you are happy to switch to PowerShell, a solution can be found or adapted from the post :

Powershell one-liner to show process on same line as port using netstat issue

  • 3
    Answer? or comment?
    – Biswapriyo
    May 15 '18 at 8:34
  • @Biswapriyo: Maybe both - it does answer the question, and especially if the poster accepts it (in that case the post becomes duplicate of my link).
    – harrymc
    May 15 '18 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.