Check port usage in linux

Source: Internet
Author: User

Check port usage in linux

1. Start a jetty server in the Fedora20 system. port 8080;

2. Run the following command:

[doctor@localhost bin]$ lsof -i:8080COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAMEjava    10033 doctor  180u  IPv6 253547      0t0  TCP *:webcache (LISTEN)[doctor@localhost bin]$ 

Obtain PID 10033.

3. Run the following command:

[doctor@localhost ~]$ ps aux |grep 10033doctor   10033  1.7 12.4 6044780 979184 pts/1  Sl   11:07   0:34 /home/doctor/opt/jdk1.8.0_25/bin/java -Djetty.home=/home/doctor/opt/jetty9-jenkins -Djetty.base=/home/doctor/opt/jetty9-jenkins -Djava.io.tmpdir=/tmp -jar /home/doctor/opt/jetty9-jenkins/start.jar jetty-started.xmldoctor   10874  0.0  0.0 112696  2300 pts/1    S+   11:41   0:00 grep --color=auto 10033[doctor@localhost ~]$ 

Or

[doctor@localhost ~]$ ps u 10033 |catUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMANDdoctor   10033  1.5 12.4 6044780 979184 pts/1  Sl   11:07   0:34 /home/doctor/opt/jdk1.8.0_25/bin/java -Djetty.home=/home/doctor/opt/jetty9-jenkins -Djetty.base=/home/doctor/opt/jetty9-jenkins -Djava.io.tmpdir=/tmp -jar /home/doctor/opt/jetty9-jenkins/start.jar jetty-started.xml[doctor@localhost ~]$ 

The cat display is mainly for line breaks, so that the information is fully displayed.

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.