메뉴 건너뛰기

조회 수 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

    centos 버전 확인

    Date2015.07.16 Views7614
    Read More
  2. No Image

    리눅스 서버 백업 - Crontab

    Date2014.03.26 Views7619
    Read More
  3. No Image

    긴급 스왑 메모리 추가 하기

    Date2014.03.26 Views7622
    Read More
  4. 리눅스,사용자계정(관련 파일,명령어)

    Date2014.10.30 Views7624
    Read More
  5. No Image

    Tomcat 6에 Datasource 설정하기

    Date2017.03.11 Views7624
    Read More
  6. No Image

    yum (Yellowdog Updater Modified) 명령어 정리

    Date2014.02.27 Views7625
    Read More
  7. No Image

    컴파일을 이용하여 Apache 최신버전을 설치하자

    Date2016.03.18 Views7632
    Read More
  8. No Image

    리눅스 기본보안설정(1-8)

    Date2014.05.15 Views7636
    Read More
  9. No Image

    리눅스/RAID 설정하기 2

    Date2016.07.22 Views7645
    Read More
  10. No Image

    CentOS 7 Subversion(SVN)

    Date2015.07.17 Views7648
    Read More
  11. Centos7 64bit 웹서버 만들기-mysql설치 CAP4

    Date2015.07.17 Views7655
    Read More
  12. No Image

    리눅스 해킹사고 분석 및 대응절차

    Date2014.03.26 Views7662
    Read More
  13. No Image

    CentOS 7 에 php 설치하기

    Date2015.07.16 Views7663
    Read More
  14. No Image

    iptables 접속 차단 스크립트

    Date2014.04.23 Views7665
    Read More
  15. No Image

    apache, mod_ssl 설치 (apache 1.3.37버전)

    Date2014.02.27 Views7667
    Read More
  16. No Image

    Apache(아파치)를 사용해 redirect(리다이렉트) 하는 방법 7

    Date2014.02.27 Views7667
    Read More
  17. No Image

    php http include

    Date2016.03.18 Views7685
    Read More
  18. No Image

    리눅스 - 동시접속자 확인 방법

    Date2014.02.27 Views7699
    Read More
  19. No Image

    CentOS 7 FTP Server 설치

    Date2015.07.17 Views7701
    Read More
  20. No Image

    mariadb | my.cnf 설정. MariaDB(5.5.37) utf8 설정

    Date2015.07.16 Views7711
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved