1. Check if the server port is occupied
>lsof-i:8081
2. View all ports on the server
>netstat-ntlp
3. Check if the server is open for a port
TCP port: >NETSTAT-NTPL
UDP port: >NETSTAT-NUPL
Common parameters:
-A (All) displays all options and does not show listen related by default
-T (TCP) displays only TCP-related options
-U (UDP) displays only UDP-related options
-N refuses to display aliases, showing all numbers converted to numbers.
-l list only service status in Listen (listening)
-P Displays the program name that establishes the associated link
-R display routing information, routing table
-e display extended information, such as UID, etc.
-S statistics according to each protocol
-C executes the netstat command every other fixed time.
Hint: The status of listen and listening can only be seen with-a or-l
See if ports are occupied and view all ports under Linux