— tomauger.com

Unix/linux 1-liner to see all unique visitors in your server’s web logs

Here’s a quickie. For those of you finger hackers out there, this one-liner will look through all available logs (including backups) and come up with a count of unique visitors. Just in case your built-in server stats aren’t working and you haven’t signed up with Google Analytics.

zcat access.log*| awk '{print $1}' | sort | uniq -c |sort -n | wc -l