In the Unix operating system, a port is a communication endpoint for a specific service. Ports are used to identify the service that a program is listening on, and to establish connections between programs. There are a number of different ways to check which ports are open on a Unix system, and which programs are listening on those ports.
One common way to check ports is to use the netstat command. The netstat command displays a list of all active network connections, including the port numbers that are being used. To use netstat, simply type the following command into a terminal window: