The reason people are suggesting nmap, by the way, is because is uses TCP fingerprinting to provide a "best guess" at an operating system. The fingerprinting tends to be pretty accurate - just make sure you have an up-to-date version of nmap.
I seem to remember this same question coming up the other day from someone trying to identify machines via various banners, which is a **VERY BAD IDEA INDEED**. The others are right - use nmap.