Signal9Signal9 — home
online
back to labs

Awk: Associative Arrays (Counting)

MediumSed & Awk5-10 min
The brief

/root/work/access.log lists a client IP in column 1 per request.

Produce a per-IP request count into /root/work/out.txt: one 'IP count' line per unique IP (the IP, whitespace, then its request count — e.g. '192.0.2.10 4'), SORTED by IP. Plain sort order and numeric IP order (sort -V) are both accepted.

Grading compares against that sorted tally.

What you'll do
  • Count the requests per unique client IP
  • Emit one 'IP count' line per IP, sorted by IP, to /root/work/out.txt

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.