Redis stores keys and values in memory.

Sometimes we want to find the numbers of keys in Redis.

how to print the count number of keys

There are multiple ways to get keys counted in Redis First way,> keys *
1) "roles"> dbsize
(integer) 1> info keyspace
# Keyspace

Command To get all available keys

One way is using the Key * command

Another way is using the scan command redis-cli –scan –pattern ‘*’