1.List the visitors
BeginnerPrint each IP address in access.log once, sorted.
cat > access.log <<'EOF'
192.168.1.10 - - [12/Nov/2026:09:00:01] "GET /index.html HTTP/1.1" 200 512
192.168.1.11 - - [12/Nov/2026:09:00:05] "GET /about.html HTTP/1.1" 200 1024
192.168.1.10 - - [12/Nov/2026:09:01:10] "POST /login HTTP/1.1" 302 0
10.0.0.5 - - [12/Nov/2026:09:02:00] "GET /admin HTTP/1.1" 403 128
192.168.1.12 - - [12/Nov/2026:09:03:30] "GET /missing.html HTTP/1.1" 404 256
192.168.1.10 - - [12/Nov/2026:09:04:45] "GET /index.html HTTP/1.1" 200 512
10.0.0.5 - - [12/Nov/2026:09:05:12] "GET /admin HTTP/1.1" 403 128
192.168.1.11 - - [12/Nov/2026:09:06:00] "GET /api/orders HTTP/1.1" 500 64
192.168.1.13 - - [12/Nov/2026:09:07:20] "GET /index.html HTTP/1.1" 200 512
192.168.1.12 - - [12/Nov/2026:09:08:05] "GET /contact.html HTTP/1.1" 200 768
EOFShow hint
grep -o prints only the matching part. An IP address here is digits and dots at the start of the line.
Show solution
grep -oE '^[0-9.]+' access.log | sort -u10.0.0.5
192.168.1.10
192.168.1.11
192.168.1.12
192.168.1.13