Linux finds port number through OS process PID

Source: Internet
Author: User

[[email protected] ~]# netstat-tulpnactive Internet connections (only servers) Proto recv-q send-q Local Address Foreign Address State Pid/program name TCP 0 0 127.0.0.1:2208 0.0.0                   .0:* LISTEN 3338/./hpiod TCP 0 0 0.0.0.0:736 0.0.0.0:* LISTEN 3098/rpc.statd TCP 0 0 127.0.0.1:37094 0.0.0.0:* Liste N 4418/ocssd.bin TCP 0 0 0.0.0.0:54955 0.0.0.0:* LISTEN 4919/or A_D000_ORCL TCP 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3058/portmap t      CP 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 4974/tnslsnr TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3358/sshd TCP 0 0 127.0.0.1 : 631 0.0.0.0:* LISTEN 3369/cupsd TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3404/sendmail TCP 0 0 127.0.0.1:43259 0.0.0.0:* Liste N 4418/ocssd.bin TCP 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 3343/py Thon UDP 0 0 127.0.0.1:33429 0.0.0.0:* 4418/ocssd.bin u      DP 0 0 127.0.0.1:20633 0.0.0.0:* 4921/ORA_S000_ORCL UDP 0 0 0.0.0.0:21080 0.0.0.0:* 3763/avahi-daemon UDP 0 0 127.0.0.1                 : 13017 0.0.0.0:* 4891/ora_pmon_orcl UDP 0 0 0.0.0.0:730                         0.0.0.0:* 3098/rpc.statd UDP 0 0 0.0.0.0:733 0.0.0.0:*       3098/RPC.STATD UDP 0 0 127.0.0.1:7394 0.0.0.0:* 4418/oc Ssd.bin UDP 0 0 0.0.0.0:5353 0.0.0.0:* 3763/avahi-daemon u      DP 0 0 127.0.0.1:63341 0.0.0.0:* 4418/ocssd.bin UDP 0 0 0.0.0.0:111 0.0.0.0:* 3058/portmap UDP 0 0 0.0.0.0:6             0.0.0.0:* 3369/cupsd UDP 0 0 127.0.0.1:16633                                0.0.0.0:* 4919/ORA_D000_ORCL UDP 0 0 127.0.0.1:61818 0.0.0.0:*       4418/ocssd.bin


The following port numbers are checked against the OS process ID (4974):

[Email protected] ~]# Netstat-nap | grep 4974tcp        0      0 0.0.0.0:1521                0.0.0.0:*                   LISTEN      4974/tnslsnr        tcp        0      0 127.0.0.1:1521              127.0.0.1:11798             established 4974/tnslsnr        UNIX  2      [ACC]     STREAM     LISTENING     15990  4974/tnslsnr        /var/tmp/.oracle/s#4974.1unix  2      [ACC]     STREAM     LISTENING     15992  4974/tnslsnr        /var/tmp/.oracle/s#4974.2unix  3      []         STREAM     CONNECTED     14974  4663/gconfd-2       

Linux finds port number through OS process PID

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.