netstat -tulnp
-t (tcp) show only tcp related
-u (udp) show only relevant udp
-l (listening) show only port listening service
-n (numeric) does not resolve the name, do not use an alias numerical (for example: localhost will turn into 127.0.0.1)
-p (programs) show PID and program name of the port
By netstat -tulnp | grep port numbers to view the current port number is occupied
E.g:
netstat -tulnp|grep 3306
3306 can be seen mysql port is occupied.