redis-cli

Redis command-line client for cache and data structure inspection.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

redis-cli is the interactive and scripted client for Redis. Used for inspecting cache contents, monitoring live commands, checking memory usage, and diagnosing performance issues. The MONITOR command streams all Redis commands in real time.

Common flags
FlagMeaning
-hHost (default: 127.0.0.1)
-pPort (default: 6379)
-nDatabase number
--statLive stats mode
--scanScan keys matching pattern
Examples
redis-cli INFO memoryCheck memory usage and fragmentation · explain & risk-check →
redis-cli MONITORStream all Redis commands in real time · explain & risk-check →
redis-cli --statLive statistics: memory, keys, ops/sec · explain & risk-check →
redis-cli DBSIZENumber of keys in current database · explain & risk-check →
redis-cli --scan --pattern 'session:*' | wc -lCount session keys matching pattern · explain & risk-check →
redis-cli --bigkeysFind the largest keys in the database · explain & risk-check →
Pro tip

Use `redis-cli --bigkeys` to find oversized keys before they cause memory pressure. Use `--scan` instead of `KEYS *` in production — KEYS * blocks Redis for the entire scan duration.

Related
psql ss advanced jq
Open the full explainer →More in Databases

Reference text is hand-written and may be incomplete — check man redis-cli for your version. Test destructive commands on a non-production system first.