(Transfer) Port occupation under linux

Use the command:

ps -aux | grep  tomcat

It was found that there is no Tomcat process on port 8080.

Use the command: netstat –apn

View all processes and port usage. Find the list of processes below, where the last column is the PID/Program name 

clip_image002

It is found that port 8080 is occupied by the Java process with PID 9658.

Further use the command: ps -aux | grep java, or directly: ps -aux | grep pid to view

clip_image004

You can clearly know which program is occupied by port 8080! Then judge whether to use the KILL command to kill!

Use netstat -anp | grep portno directly
: netstat -apn | grep 8080

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326848119&siteId=291194637