TCP network applications require a port to communicate on. Before we configure an application to use a specific port it's a good idea to check if it's already in use. Here are some commands to help with that task.
To find out what ports are in use on Windows use
As administrator - netstat -aonb -p TCP | more
As any user- netstat -aon -p TCP | more
The difference between them is that the one which requires admin also returns the name of the process using the port.
And for Linux we have