linux check which service occupies port code example
Example 1: find out which procses is using port linux
sudo lsof -i:<port_number>
Example 2: linux see used ports
netstat -tulpn
sudo lsof -i:<port_number>
netstat -tulpn