Msg#: 4074914 posted 3:22 pm on Feb 5, 2010 (gmt 0)
Mobile devices send user agent strings which can be easily identified. If you are using Apache as webserver, the user agent strings are stored in the file agent_log, which is probably stored in the /var/log/httpd directory, depending on your Linux flavor.
Counting the number of matching lines would give a good indication of the current number of mobile visitors. Although not perfect, the following Linux command line should provide you with most of the user agents matching a mobile device:
grep "Opera Mini\|Mobile\|SymbianOS\|SymbOS\|webOS\|BlackBerry" agent_log | wc -l gives the number of hits on your site by mobile browers.
wc -l agent_log gives the total number of hits on your site.