How to tell which ports are in use on a machine?


    Jul 29 2013 | 8:41 pm
    Anybody know how to tell which ports are in use on a Mac? And on a PC? The goal is to avoid the ports in use when setting up communications via upd, etc..
    Thanks!
    Jeff

    • Jul 29 2013 | 10:37 pm
      Hi,
      netstat is your friend:
      $ netstat -p tcp
      
      and
      $ netstat -p udp
      
      will list you the active TCP and UDP ports, respectively. For more info, have a look at
      $ man netstat
      
      HTH, Ádám
    • Jul 30 2013 | 1:37 pm
      Thanks, Ádám!
      Jeff