generatetoaddress nblocks address (maxtries)

The generatetoaddress RPC mines to a specified address and returns the block hashes.

*bitcoin-cli help generatetoaddress

generatetoaddress nblocks "address" ( maxtries )

Mine to a specified address and return the block hashes.

Arguments:
1. nblocks     (numeric, required) How many blocks are generated.
2. address     (string, required) The address to send the newly generated bitcoin to.
3. maxtries    (numeric, optional, default=1000000) How many iterations to try.

Result:
[           (json array) hashes of blocks generated
  "hex",    (string) blockhash
  ...
]

Examples:

Generate 11 blocks to myaddress
> bitcoin-cli generatetoaddress 11 "myaddress"
If you are using the Bitcoin Core wallet, you can get a new address to send the newly generated bitcoin to with:
> bitcoin-cli getnewaddress