how to check if a port is open windows 10 code example
Example 1: see what ports are in use
Get-Process -Id (Get-NetTCPConnection -LocalPort portNumber).OwningProcess
Example 2: how to check listening ports on a server
sudo ss -tulwn | grep LISTEN