Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to check the port occupation process number and program name under Linux

Shulou Source: shulou.com Published: 2022-05-31 12:05:32 11月13日 Update

This article introduces the relevant knowledge of "how to check the port occupation process number and program name under Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Check the port occupancy under linux:

1. See which process occupies port 819:

Case9-sghfofo:/usr/local/cnbj/tomcat-bj/bin # lsof-iRu 859

The result after running:

Command pid user fd type device size node name

Java 24907 root 31U ipv4 248905027 tcp *: 859 (listen)

From the above we know that port 859 is occupied by a process with process number 24907, which is a java process.

two。 See where the process with process number 24907 is:

Case9-sghfofo:/usr/local/cnbj/tomcat-bj/bin # ps-ef | grep 24907

Root 13421 29276 0 20:08 pts/2 00:00:00 grep 24907

Root 24907 10 11:43 pts/4 00:03:53 / usr/java/jdk1.6.0_13/bin/java-server-xx:permsize=256m-xx:maxpermsize=512m-xbootclasspath/p:java-net-socket.jar-djava.util.logging.manager=org.apache.juli.classloaderlogmanager-djava.util.logging.config.file=/usr/local/cnsh/tomcat-sh/conf/logging.properties-djava.endorsed.dirs=/usr/local/cnsh/tomcat-sh/bin/endorsed-classpath: / usr/local / cnsh/tomcat-sh/bin/bootstrap.jar-dcatalina.base=/usr/local/cnsh/tomcat-sh/bin-dcatalina.home=/usr/local/cnsh/tomcat-sh/bin-djava.io.tmpdir=/usr/local/cnsh/tomcat-sh/bin/temp-xmx512m-xms256m org.apache.catalina.startup.bootstrap start

From the above, we know that the tomcat with the directory / usr/local/cnsh/tomcat-sh/bin/ is occupied.

This is the end of the content of "how to check the port occupation process number and program name under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Process port program name content situation more knowledge practicality achievement next dilemma actual article case catalog result ribbon website industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno Linux macOS Shulou Technology