How do I get testnet block height? Like I would do wget -O - http://blockchain.info/q/getblockcount 2&gt;/dev/null for the main net.
Blockchain.info does not track the testnet, but blockexplorer.com does. In fact the API you're using was originally from blockexplorer.com, and blockchain.info simply adopted it.

wget -O - http://blockexplorer.com/testnet/q/getblockcount 2&gt; /dev/null


or shorter

curl http://blockexplorer.com/testnet/q/getblockcount