There are two ways to get all keys from the all databases in Redis.
The first way is to list keys using
--scan option and the second one is to get all keys using the
Note that the first way of getting all keys is preferable as it doesn’t require the client to load all the keys into memory despite of the
KEYS command only when the key space is reasonably sized.
Cool Tip: Delete all keys from the all databases in Redis! Read more →
Get All Keys In Redis
Get all keys using the
$ redis-cli --scan --pattern '*'
List all keys using the
$ redis-cli KEYS '*'