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

Jul 29, 2013 at 1:41pm

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

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

#257528
Jul 29, 2013 at 3:37pm

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

#257540
Jul 30, 2013 at 6:37am

Thanks, Ádám!

Jeff

#257592

You must be logged in to reply to this topic.