use command: Ps-aux | grep Tomcat found that there is no 8080 port for the Tomcat process. Use the command: NETSTAT–APN to see all process and port usage. Discover the following list of processes, where the last column is pid/program name discovery 8080 Port is occupied by the PID 9658 Java process. Further use of the command: Ps-aux | grep Java, or directly: Ps-aux | grep PID View will be able to clearly know that the 8080 port is what the program occupied! Then decide if you want to kill with the KILL command!
method Two: Direct use of NETSTAT-ANP | grep PortNo
namely: NETSTAT–APN | grep 8080
view port status under LinuxDuring Linux use, it is necessary to understand which ports are open to the current system, and to see the specific processes and users that open these ports, you can simply query through the netstat command
- The parameters of the netstat command are described below:
- -T: Indicates that the TCP port is displayed
- -U: Indicates the display of UDP ports
- -L: Only listen sockets (so-called sockets are programs that enable applications to read and receive communication protocols (protocol) and data)
- -P: Displays the process identifier and program name, and each socket/port belongs to a program.
- -N: Do not perform DNS polling, display IP (can speed up operation)
- All ports and process services on the current server can be displayed, with grep combined to see a specific port and service situation • • Netstat-ntlp
- View all current TCP ports NETSTAT-NTULP |grep 80//View all 80 port usage Netstat-an | grep 3306//View all 3306 port usage ·
- For example, to see if the current MySQL default port 3306 is started, you can do the following:
Linux Viewer Port Usage