Also, if not using the command line (i.e. using Python or PHP) you can use "*" as the account name and it actually will wildcard all accounts.
Python: (requires python-jsonrpc package)
#!/bin/python
from jsonrpc import ServiceProxy
from jsonrpc.proxy import JSONRPCException
from jsonrpc.json import JSONDecodeException
RPC = ServiceProxy("http://%s:%s@%s:%s" % ('yourusername', 'yourpassword', '127.0.0.1', 8332))
try:
print "%s" % RPC.getbalance("*", 0)
except JSONRPCException, e:
print e.error['message']
except:
pass
PHP: (requires jsonRPCClient Class)
<?php
require_once("jsonRPCClient.php");
$RPC = new jsonRPCClient("http://yourusername:yourpassword@127.0.0.1:8332");
echo $RPC->getbalance("*", 0);
?>