check ports which are in use rpi code example
Example 1: open ports on RPI
netstat -lptn
Example 2: open ports on RPI
netstat --tcp --listening --programs --numeric
netstat -lptn
netstat --tcp --listening --programs --numeric