From mining to sending via RPC
Put your client into regtest mode. This allows you to mine an arbitrary amount of blocks very quickly. Add this to your bitcoin.conf

regtest=1
daemon=1

Generate the blocks. Run 

bitcoin-cli setgenerate true &lt;number of blocks&gt;


where X is the number of block you want. You'll want at least 101 blocks.
See the mined blocks. Run

bitcoin-cli getblockhash &lt;index&gt;


to get the hash of block number &lt;index&gt;. Then take that hash and run

bitcoin-cli getblock &lt;hash&gt;

Repeat Step 3 for each block you want.
Send the Bitcoins to a new address. Run

bitcoin-cli getbalance


to find out your balance. Run

bitcoin-cli sendtoaddress &lt;address&gt; &lt;amount&gt;



If you don't need to see the contents of the block, you can skip steps 3 and 4.