netstat listen on port code example Example 1: cmd listening ports C:\> netstat -a -b Example 2: how to check listening ports on a server sudo ss -tulwn | grep LISTEN