I'm running bitcoind and I want to send all my coins to another address. What is the command for this?
To be strict, OP asked to send all coins, which @eatingthenight didn't answer.
The key thing to do this is the last optional bool argument of the
sendtoaddress RPC command called
subtractfeefromamount. The way to use it is:
bitcoin-cli walletpassphrase <passphrase> <timeoutInSeconds> bitcoin-cli sendtoaddress <bitcoinaddress> `bitcoin-cli getbalance` "" "" true
sendtoaddress <bitcoinaddress> <amount>
will do the trick.
Look at the bitcoind api for more info: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list