포트를 사용하고 있는 프로세스 및 파일 현황 조회 netstat를 이용하여 Listen Port 및 해당 프로세스 조회 lsof
로빈아빠
본문
1. netstat를 이용하여 Listen Port 및 해당 프로세스 조회
[root@linux root]# netstat -pn | grep tcp | grep EST
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 10.20.3.23:80 xxx.xxx.xxx.6:31342 ESTABLISHED 14143/httpd
tcp 0 0 10.20.3.23:80 xxx.xxx.xxx.3:4399 ESTABLISHED 12007/httpd
...
2. lsof
[root@linux root]# lsof -p 14143
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 14143 root cwd DIR 8,1 4096 2 /
httpd 14143 root rtd DIR 8,1 4096 2 /
httpd 14143 root txt REG 8,1 1474564 227505 /usr/local/apache/bin/httpd
httpd 14143 root mem REG 8,1 89547 240534 /lib/ld-2.2.5.so
httpd 14143 root mem REG 8,1 45415 240567 /lib/libnss_files-2.2.5.so
httpd 14143 root mem REG 8,1 20666 304885 /usr/lib/gconv/gconv-modules.cache
httpd 14143 root mem REG 8,1 35340 240623 /lib/libpam.so.0.75
httpd 14143 root mem REG 8,1 173359 448991 /lib/i686/libm-2.2.5.so
httpd 14143 root mem REG 8,1 12102 240547 /lib/libdl-2.2.5.so
httpd 14143 root mem REG 8,1 23575 240545 /lib/libcrypt-2.2.5.so
httpd 14143 root mem REG 8,1 68925 240579 /lib/libresolv-2.2.5.so
httpd 14143 root mem REG 8,1 89424 240551 /lib/libnsl-2.2.5.so
httpd 14143 root mem REG 8,33 8329355 1651663 /data2/oracle/app/920/lib/libclntsh.so.9.0
httpd 14143 root mem REG 8,1 277324 368772 /usr/lib/libdb2.so.3
httpd 14143 root mem REG 8,1 141735 368883 /usr/lib/libexpat.so.0.1.0
httpd 14143 root mem REG 8,33 8232 1651608 /data2/oracle/app/920/lib/libwtc9.so
httpd 14143 root mem REG 8,1 101902 448993 /lib/i686/libpthread-0.9.so
httpd 14143 root mem REG 8,1 173680 320718 /usr/lib/locale/en_US.iso885915/LC_CTYPE
httpd 14143 root mem REG 8,1 46117 240575 /lib/libnss_nisplus-2.2.5.so
httpd 14143 root mem REG 8,1 16051 240564 /lib/libnss_dns-2.2.5.so
httpd 14143 root mem REG 8,1 1401027 448989 /lib/i686/libc-2.2.5.so
httpd 14143 root 0r CHR 1,3 97953 /dev/null
httpd 14143 root 1w CHR 1,3 97953 /dev/null
httpd 14143 root 2w FIFO 0,5 57596943 pipe
httpd 14143 root 3r REG 8,33 15872 65444 /data2/oracle/app/920/rdbms/mesg/ocius.msb
httpd 14143 root 4w FIFO 0,5 57596943 pipe
httpd 14143 root 5r FIFO 0,5 57596944 pipe
httpd 14143 root 6w FIFO 0,5 57596944 pipe
httpd 14143 root 15u IPv4 16459 TCP *:http (LISTEN)
[root@linux root]# netstat -pn | grep tcp | grep EST
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 10.20.3.23:80 xxx.xxx.xxx.6:31342 ESTABLISHED 14143/httpd
tcp 0 0 10.20.3.23:80 xxx.xxx.xxx.3:4399 ESTABLISHED 12007/httpd
...
2. lsof
[root@linux root]# lsof -p 14143
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 14143 root cwd DIR 8,1 4096 2 /
httpd 14143 root rtd DIR 8,1 4096 2 /
httpd 14143 root txt REG 8,1 1474564 227505 /usr/local/apache/bin/httpd
httpd 14143 root mem REG 8,1 89547 240534 /lib/ld-2.2.5.so
httpd 14143 root mem REG 8,1 45415 240567 /lib/libnss_files-2.2.5.so
httpd 14143 root mem REG 8,1 20666 304885 /usr/lib/gconv/gconv-modules.cache
httpd 14143 root mem REG 8,1 35340 240623 /lib/libpam.so.0.75
httpd 14143 root mem REG 8,1 173359 448991 /lib/i686/libm-2.2.5.so
httpd 14143 root mem REG 8,1 12102 240547 /lib/libdl-2.2.5.so
httpd 14143 root mem REG 8,1 23575 240545 /lib/libcrypt-2.2.5.so
httpd 14143 root mem REG 8,1 68925 240579 /lib/libresolv-2.2.5.so
httpd 14143 root mem REG 8,1 89424 240551 /lib/libnsl-2.2.5.so
httpd 14143 root mem REG 8,33 8329355 1651663 /data2/oracle/app/920/lib/libclntsh.so.9.0
httpd 14143 root mem REG 8,1 277324 368772 /usr/lib/libdb2.so.3
httpd 14143 root mem REG 8,1 141735 368883 /usr/lib/libexpat.so.0.1.0
httpd 14143 root mem REG 8,33 8232 1651608 /data2/oracle/app/920/lib/libwtc9.so
httpd 14143 root mem REG 8,1 101902 448993 /lib/i686/libpthread-0.9.so
httpd 14143 root mem REG 8,1 173680 320718 /usr/lib/locale/en_US.iso885915/LC_CTYPE
httpd 14143 root mem REG 8,1 46117 240575 /lib/libnss_nisplus-2.2.5.so
httpd 14143 root mem REG 8,1 16051 240564 /lib/libnss_dns-2.2.5.so
httpd 14143 root mem REG 8,1 1401027 448989 /lib/i686/libc-2.2.5.so
httpd 14143 root 0r CHR 1,3 97953 /dev/null
httpd 14143 root 1w CHR 1,3 97953 /dev/null
httpd 14143 root 2w FIFO 0,5 57596943 pipe
httpd 14143 root 3r REG 8,33 15872 65444 /data2/oracle/app/920/rdbms/mesg/ocius.msb
httpd 14143 root 4w FIFO 0,5 57596943 pipe
httpd 14143 root 5r FIFO 0,5 57596944 pipe
httpd 14143 root 6w FIFO 0,5 57596944 pipe
httpd 14143 root 15u IPv4 16459 TCP *:http (LISTEN)
댓글목록
등록된 댓글이 없습니다.