메뉴 건너뛰기

조회 수 7699 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
# netstat -ant |grep :80 |grep ES |awk '{print $5}' | cut -f 1 -d : |sort | uniq
포트 80에 ESTABLISHED 된 Connection 추출 후 Foreign Address(IP)만 잘라 sort 시킨 후 uniq한 IP만 뽑는다.

갯수를 알고 싶다면 위 명령어 맨 뒤에 <|wc -l>만 붙히면 된다.
# netstat -ant |grep :80 |grep ES |awk '{print $5}' | cut -f 1 -d : |sort | uniq |wc -l


[root@test ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:948 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 836 ::ffff:192.168.0.100:22 ::ffff:222.xxx.xxx.xxx:4177 ESTABLISHED

앞에 불필요한 7자의 문자가 있을 경우 잘라버리고 8번째 문자부터 출력 => cut -c8-
# netstat -ant |grep :80 |grep ES |awk '{print $5}' |cut -c8- |cut -f 1 -d : |sort | uniq |wc -l

  1. No Image

    split 명령어 (파일 나누기)

    Date2021.03.26 Views76956
    Read More
  2. No Image

    [CentOS 7] SSH 무작위 로그인 시도 막기 ( Fail2Ban )

    Date2018.03.28 Views69817
    Read More
  3. tomcat - server.xml 설정

    Date2017.03.11 Views67378
    Read More
  4. No Image

    리눅스서버 모니터링 rstatd 설치

    Date2017.04.28 Views27358
    Read More
  5. No Image

    fdisk로 파티션 삭제하기

    Date2015.06.10 Views26188
    Read More
  6. No Image

    fdisk로 파티션 삭제하기

    Date2015.06.09 Views21723
    Read More
  7. CentOS6.6+httpd2.4.16+Mariadb10.0.20+php5.6.11 Source 설치....

    Date2016.09.25 Views14751
    Read More
  8. No Image

    bash 스크립트에서 네트워크 정보 확인하기

    Date2014.02.27 Views14308
    Read More
  9. No Image

    원격 접속 FreeNX (NOMACHINE) 설치/접속 (vnc 보다 훨

    Date2014.02.27 Views12316
    Read More
  10. No Image

    리눅스 읽기전용 파일시스템 / 파일 입/출력 오류

    Date2016.07.22 Views12176
    Read More
  11. Centos7 64bit 웹서버 만들기-PHP설치 CAP5

    Date2015.07.17 Views11979
    Read More
  12. No Image

    php-5.2.17 make시에 오류 발생 make: *** [ext/dom/node.lo] 오류 1

    Date2016.03.18 Views10748
    Read More
  13. No Image

    이온큐브로더(ioncube) 설치 매뉴얼

    Date2016.03.18 Views10396
    Read More
  14. No Image

    웹서버 모니터링 툴 awststs

    Date2014.03.26 Views10319
    Read More
  15. No Image

    CentOS 7 에 아파치(httpd) 설치

    Date2015.07.16 Views10310
    Read More
  16. No Image

    파일 속성 명령어 : chattr, lsattr

    Date2014.02.27 Views9626
    Read More
  17. No Image

    libphp5.so: undefined symbol: unixd_config

    Date2016.03.18 Views9577
    Read More
  18. No Image

    iptable에서 TCP SYN Flooding 차단 설정

    Date2014.02.27 Views9555
    Read More
  19. [CentOS 6.5] Tomcat 설치 및 구동

    Date2017.03.11 Views9483
    Read More
  20. MySQL Linux Port 방화벽 설정(3306)

    Date2017.03.11 Views9471
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved