redis commands
32 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 32 shown
-
redis-cli -h redis -p 6379 -a <password>Open interactive Redis CLI session
-
redis-cli -h redis INFO allFull server information: memory, CPU, clients, persistence
-
redis-cli -h redis MONITORStream all commands executed on the Redis server
-
redis-cli -h redis SLOWLOG GET 20Show last 20 slow queries with execution time
-
redis-cli -h redis MEMORY USAGE <key>Show bytes consumed by a specific key
-
redis-cli -h redis FLUSHDB ASYNCDelete all keys in current DB asynchronously
-
redis-cli -h redis BGSAVETrigger background RDB snapshot save
-
redis-cli -h redis INFO replicationShow master/replica role, replication offset, connected replicas
-
redis-cli -h redis --scan --pattern 'session:*' | head -20Non-blocking key scan by pattern (prefer over KEYS in production)
-
redis-cli -h redis TTL <key>Remaining TTL in seconds; -1 = no expiry, -2 = not found
-
redis-cli MONITOR | grep -v PINGStream every command sent to Redis (exclude health pings)
-
redis-cli SLOWLOG GET 20Last 20 slow commands with execution time in microseconds
-
redis-cli --scan --pattern 'session:*' | xargs -n1 redis-cli MEMORY USAGE | awk '{sum+=$1} END{print sum/1024/1024" MB"}'Total memory consumed by keys matching a pattern
-
redis-cli --scan --pattern 'cache:*' | xargs -r redis-cli DELSafely scan-delete matching keys without KEYS command
-
redis-cli SET mykey 'value' EX 3600Set key with 1-hour expiry (EX = seconds)
-
redis-cli INCRBY counter:hits 1Atomically increment an integer counter
-
redis-cli PUBLISH events '{"type":"login","user":"alice"}'Publish a message to a Redis pub/sub channel
-
redis-cli SUBSCRIBE eventsSubscribe and listen to messages on a channel
-
redis-cli INFO replicationRole, connected replicas, replication lag
-
redis-cli BGSAVE && redis-cli LASTSAVETrigger background RDB save and check its timestamp
-
redis-cli -n 1 FLUSHDB ASYNCAsynchronously flush database index 1 only
-
redis-cli ZREVRANGEBYSCORE leaderboard +inf -inf WITHSCORES LIMIT 0 10Top 10 entries from a sorted set with scores
-
redis-cli XADD mystream '*' event login user aliceAppend a message to a Redis Stream with auto-ID
-
redis-cli -c CLUSTER INFO && redis-cli -c CLUSTER NODESCluster health and node list with slot ranges
-
redis-benchmark -q -n 100000 -c 50 -P 10100k requests, 50 clients, 10 pipeline depth (quiet output)
-
redis-cli --bigkeysSample keyspace to find largest keys per type; note: estimates, runs SCAN not blocking
-
redis-cli --memkeysSample keys ranked by actual memory usage, not element count; finds RAM hogs
-
redis-cli MEMORY USAGE <name> SAMPLES 0Bytes used by a single key incl overhead; SAMPLES 0 = exact for collections
-
redis-cli SLOWLOG GET 10; redis-cli SLOWLOG RESETList 10 slowest commands with args and duration, then clear the log
-
redis-cli LATENCY DOCTORHuman-readable latency analysis with likely causes; pair with LATENCY HISTORY <event>
-
redis-cli CLIENT LIST | tr ' ' '\n' | grep -E 'addr=|age=|idle=' | paste - - - | sort -t= -k3 -rn | headFind long-lived/idle connections leaking sockets; sort by age then idle
-
redis-cli --cluster check <host>:<port>Verify slot coverage, node consistency and open slots across the cluster
no commands match — try a different search