Redis CLI Essential Commands

Installation

brew install redis

Connect to Redis

redis-cli -h your-cluster-endpoint -p your-cluster-port

Query Keys

## List all keys
keys *

## Pattern matching
keys prefix-*

## Check key type
type <key>

Read Values

## String values
get <key>

## Hash values
hgetall <key>

Check Expiration

ttl <key>

Returns: