In order to use bitcoin in the command line I previously needed to start this (otherwise I get an error):

bitcoind

then I can play with:

bitcoin-cli

This will give you some useful information:

bitcoin-cli help

I configure my file bitcoin.conf to use the testnet. But some commands are only really usefull on the regnet.

Then I start using the commands available like this one:

bitcoin-cli getbestblockhash

00000000000000ec0c4ca095989933fe49e4723a1933c2272f4171aa64693e96

Some interesting commands.

Explore the blockchain
getblockchaininfo
getblockcount
verifychain
Hashing
getblockhash height

It returns the hash of a block (height of the block -a sequential number- is required as an argument)

getnetworkhashps

It returns an estimated network hashes per second based on specified number of recent blocks. It is useful for knowing when the network is running faster or slower.

getbestblockhash

The hash of the last block synced.

Blocks
getblock hash

You first need to get a hash of a block using getblockhash.

getblockheader hash

It gives you the block without transactions.

generate nblocks

It mines a number of blocks to an address in the wallet. It can be useful using the regnet. Remember to update the config file bitcoin.conf before.

regtest=1
Wallets
getwalletinfo

It provides information about the current wallet.

listwallets

It creates a list of currently loaded wallets.

walletpassphrasechange oldpass newpass

It updates the passphrase.

Mempool
getmempoolinfo

It returns details on the active state of the transaction memory pool.

getrawmempool

It returns a list of the transactions ids in the mempool.

getmempoolentry

It returns mempool data for a given transaction.

Transactions
getchaintxstats

It returns compute statistics about the total number and rate of transactions in the chain.

getrawtransaction

It returns the transaction data in a computer friendly format.

listtransactions

It returns a list of transactions for a given account.

Signature
signrawtransaction

It signs inputs for a raw transaction which is formatted to be read by a computer. In version 18 will be removed so we will use signrawtransactionwithkey and signrawtransactionwithwallet instead.

signmessage

It signs a message with the private key of an address.

Network
getnetworkinfo

It gets a high level overview of the network state you are currently on.

getpeerinfo

It returns data about each connected node.

getconnectioncount

It returns the number of connections you have to other nodes (number of peers).

Mining
getmininginfo

It returns an object with mining-related information, for example the block that is currently being mined.

prioritisetransaction

It accepts the transaction into mined blocks at a higher or lower priority.

getblocktemplate

It returns data needed to create a block.