SadServers Easy 2 "Saskatoon"

2025. 8. 10. 18:59·Linux

Scenario: "Saskatoon": counting IPs.

Description: There's a web server access log file at /home/admin/access.log. The file consists of one line per HTTP request, with the requester's IP address at the beginning of each line. 
Find what's the IP address that has the most requests in this file (there's no tie; the IP is unique). Write the solution into a file /home/admin/highestip.txt. For example, if your solution is "1.2.3.4", you can do echo "1.2.3.4" > /home/admin/highestip.txt

Root (sudo) Access: False

Test: The SHA1 checksum of the IP address sha1sum /home/admin/highestip.txt is 6ef426c40652babc0d081d438b9f353709008e93 (just a way to verify the solution without giving it away.)

Time to Solve: 15 minutes.

 

Solution

awk '{print $1}' /home/admin/access.log | sort | uniq -c | sort -nr | head -n 1 | awk '{print $2}' > /home/admin/highestip.txt

 

 

'Linux' 카테고리의 다른 글
  • Linux namespaces
  • Samba 파일 공유 서버 구축
yeseong9769
yeseong9769
  • yeseong9769
    ys.tech.blog
    yeseong9769
  • 전체
    오늘
    어제
    • 분류 전체보기 (47)
      • Artificial Intelligence (6)
      • BigData (2)
      • Cloud (12)
      • Linux (3)
      • Network (9)
      • Mobile (1)
        • Android (1)
      • 정보보안 (9)
        • Blockchain (4)
  • 블로그 메뉴

    • 홈
    • 태그
  • 태그

    anvil
    AWS
    bedrock
    Bitcoin
    boto3
    Calico
    cast
    Ceph
    cloudnative
    conda
  • hELLO· Designed By정상우.v4.10.5
yeseong9769
SadServers Easy 2 "Saskatoon"
상단으로

티스토리툴바