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:
-2: key doesn’t exist-1: key has no expirationn: seconds until expiration