Unix Tidbit: Most Requested Web Resources

This is a quick and dirty way to find the most requested static resources of your site (e.g., images or javascript files), using Unix shell commands:

grep -oE "GET /[^ \t]+\.(gif|png|js|css)" /var/log/httpd/access_log \
    | sort | uniq -c | sort -nr

Use the correct path to your system’s HTTP server access log.

You can of course also add or replace extensions, to your heart’s content.

This entry was posted in Unix Tidbits and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *