windows powershell find program name of listen port



find pid of listen port
> netstat -ano | findstr LISTEN

find program of all port (cannot use findstr or program name will disappear)
> netstat -anb

too many program running, need filter.
using powershell
>netstat -anb | select-string "LISTEN" -context 0,1



-context 0,1
first number mean print lines before match items
second number mean print lines after match items

-context 1
print lines before and after match items

留言

熱門文章