Back to commands

Hosting Operations

Read-only

Find Unusually Large Web Responses

Bandwidth, latency, or egress cost jumped, and you need to see which requests produced unusually large responses.

Command

awk '$10 ~ /^[0-9]+$/ && $10 > 1000000 {print $10, $1, $7, $9}' /var/log/nginx/access.log | sort -nr | head

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not assume a large response is suspicious. Confirm whether the path is expected content, a backup, a release artifact, or a protected export.

Expected output

Large byte counts followed by source IP, path, and status code, giving you both the object and the client to review.

System impact

Read-only. Nothing changes. The command filters log entries by byte count and prints the request path and source.

May require elevated permissions on protected paths or service-owned files.

Recovery / rollback: no state is changed.

When to use it

Use this when investigating bandwidth spikes, slow responses, repeated downloads, or unexpected large exports.

When not to use it

Do not assume a large response is suspicious. Confirm whether the path is expected content, a backup, a release artifact, or a protected export.

next steps

Related commands

Hosting Operations Read-only

Group Server Errors by URL Path

A 500 spike is easier to triage when the broken path is obvious.

awk '$9 ~ /^5/ {count[$7]++} END {for (path in count) print count[path], path}' /var/log/nginx/access.log | sort -nr | head
Hosting Operations Read-only

Find Top 404 URLs

The missing file was not random. The access log had a pattern.

awk '$9==404 {print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head
Hosting Operations Read-only

See Top Referrers

LinkedIn traffic was not a guess. The referrer field showed it.

awk -F'"' '{print $4}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head
Hosting Operations Read-only

Summarize HTTP Status Codes

Before chasing individual lines, get the shape of the whole log.

awk '{count[$9]++} END {for (code in count) print count[code], code}' /var/log/nginx/access.log | sort -nr
Cybersecurity Triage Read-only

Find the IPs Creating the Most 4xx Noise

One address can turn a normal access log into a wall of failed requests.

awk '$9 ~ /^4/ {count[$1]++} END {for (ip in count) print count[ip], ip}' /var/log/nginx/access.log | sort -nr | head
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.