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 count in redis First way,> keys *
1) "roles"> dbsize
(integer) 1> info keyspace
# Keyspace

Command To get all avialiable keys

One way is using Key * command

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