I play in 1.5.2, and right now I'm working on using commands. I see that there's a /testfor command when I write /help, but what does this even mean? What is it and how do I use it? Edit: This question is not a copy: 1.5.2 commands could very possibly be different than the latest version.
/testfor, in a command block paired with a comparator, counts how many entities match specified conditions. For instance,
testfor Unionhawk will emit a signal if I am online.
testfor @a[x=0,y=64,z=0,r=3,m=0] counts the number of players within 3 blocks of 0,64,0.
/testfor is not particularly useful. Most of the time you will want to use scoreboard commands to work with entities matching desired criteria, since you can use scores in other commands.