Redis Admin and redis-cli Cheat Sheet

redis-cli operational workflows, latency inspection, slowlog, config, ACL, clients, and safe administrative controls.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## redis-cli workflows
Run a single command from shell
redis-cli GET app:name

# Execute one command non-interactively.

Print raw output
redis-cli --raw LRANGE jobs 0 -1

# Return plain output suitable for shell pipelines.

Print CSV output
redis-cli --csv HGETALL user:1

# Render replies as CSV.

Run latency doctor
redis-cli --latency-doctor

# Inspect latency spikes and advice from the server.

Track latency continuously
redis-cli --latency-history -i 1

# Sample latency continuously at an interval.

Find big keys
redis-cli --bigkeys

# Scan for the largest keys by data type.

Find memory-heavy keys
redis-cli --memkeys

# Scan for keys consuming large amounts of memory.

Show live stats
redis-cli --stat

# Continuously display ops, mem, clients, and other stats.

Scan keys from shell
redis-cli --scan --pattern 'user:*'

# Stream matching keys to stdout.

Dump an RDB snapshot from a live server
redis-cli --rdb dump.rdb

# Request an RDB file from a live server and save it locally.

Monitor every command
MONITOR

# Stream every command processed by the server.

Read slow query log
SLOWLOG GET 20

# Show recent slow commands.

Count slowlog entries
SLOWLOG LEN

# Return how many entries are in the slow log.

Read latest latency events
LATENCY LATEST

# Show recent named latency spikes.

Server-side latency diagnosis
LATENCY DOCTOR

# Get a narrative diagnosis of latency events.

## Server administration
Read configuration values
CONFIG GET maxmemory

# Read current server configuration values.

Change a configuration value
CONFIG SET maxmemory 1gb

# Change a config value at runtime.

Rewrite config file
CONFIG REWRITE

# Persist runtime config changes back to redis.conf where possible.

Terminate a client
CLIENT KILL 127.0.0.1:55000

# Disconnect a matching client connection.

Pause client processing
CLIENT PAUSE 5000 WRITE

# Temporarily pause clients for controlled maintenance.

Resume paused clients
CLIENT UNPAUSE

# Resume client processing after a pause.

List ACL users
ACL LIST

# Inspect effective ACL rules.

Create or update an ACL user
ACL SETUSER app-user on >strongpass ~app:* +GET +SET +DEL

# Create or modify a scoped user.

Inspect one ACL user
ACL GETUSER app-user

# Read ACL rules for a single user.

Delete ACL users
ACL DELUSER old-user

# Delete one or more ACL users.

List ACL categories
ACL CAT

# List ACL categories or commands inside one category.

Delete all keys in current DB
FLUSHDB ASYNC

# Clear the selected database asynchronously.

Delete all keys in all DBs
FLUSHALL ASYNC

# Clear every logical database asynchronously.

Force a synchronous save
SAVE

# Block the server while creating an RDB snapshot.

Fork an asynchronous save
BGSAVE

# Create an RDB snapshot in the background.

Gracefully stop the server
SHUTDOWN SAVE

# Stop Redis and optionally save current state.

Recommended next

No recommendations yet.