Linux view ports occupy process number, program name method _linux

Source: Internet
Author: User
View port occupancy under Linux:
1.
To see which process is taking up 819 ports:

Case9-sghfofo:/usr/local/cnbj/tomcat-bj/bin # lsof-i:859
Results after run:
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
Java 24907 root 31u IPv4 248905027 TCP *:859 (LISTEN)

We know from the above that the 859 port is occupied by the process number 24907 process and is a Java process.

2.
To see where the 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 1 0 11:43 PTS/4 00:03:53/USR/JAVA/JDK1.6.0_13/BIN/JAVA-SERVER-XX:PERMSIZE=256M-XX:MAXPERMSIZE=512M-XBOOTC Lasspath/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

By the above we know that the directory is occupied by Tomcat for/usr/local/cnsh/tomcat-sh/bin/.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.