How to grep your server log files for number of unique IP addresses
Sometimes you’re on the run and just don’t have time to deal with Google Analytic’s fancy JavaScript charts. This will give you the number of unique IP addresses in a log file:
grep "" mylogfilename.access.log | awk '{print $1}' | sort | uniq | wc -l
This will get you the number of uniques on August 2nd.
grep "2/Aug" mylogfilename.access.log | awk '{print $1}' | sort | uniq | wc -l