Is it possible to Send the total balance of Bitcoin from the Wallet using rpc without having to specify the exact amount? I know we can send coins using the move, sendtoaddress and sendfrom commands from the console or commandline. 

However these commands require to specify an "exact" amount, meaning you need to check the balance before you execute the commands. 

Is it possible to just send all coins to an address or to oneself in the same wallet using just one command.

Hopefully someone understands what I"m talking about here.
Yes, this is possible, but you still need to check the wallet balance first.

However, you need to know the fee, as you usually specify how many BTC are supposed to arrive at the destination, rather than how much is being sent in total.

The sendtoaddress command takes 5 parameters: address, amount, comment, comment-to, subtractfeefromamount. This last option, subtractfeefromamount, is what you need.

So if your entire wallet balance is 0.1337 BTC, you could issue:


  bitcoin-cli sendtoaddress "address" 0.1337 "" "" true


Also, you can't use move, as that does not actually issue a Bitcoin transaction, but only updates internal balances.