Interactive Mode, HELP & Inspecting
Navigate the REPL, discover commands, and introspect the server.
Code
$ redis-cli
127.0.0.1:6379> PING # PONG
127.0.0.1:6379> HELP # command groups
127.0.0.1:6379> HELP @string # all string commands
127.0.0.1:6379> HELP SET # detailed SET usage
# Server info & stats
127.0.0.1:6379> INFO # everything
127.0.0.1:6379> INFO server # just the server section
127.0.0.1:6379> INFO memory # memory stats
127.0.0.1:6379> DBSIZE # number of keys in current DB
127.0.0.1:6379> CLIENT LIST # connected clients
127.0.0.1:6379> CONFIG GET maxmemory
127.0.0.1:6379> CONFIG SET maxmemory 256mb
127.0.0.1:6379> COMMAND COUNT # how many commands the server knows
# Pretty-print large replies
127.0.0.1:6379> CLIENT LIST --raw # tab-separated, no framing
# Clear screen / exit
127.0.0.1:6379> CLEAR
127.0.0.1:6379> EXITExplanation
Interactive mode is a REPL: type a command, get a reply. HELP @group lists commands by category (@string, @list, @server, @connection...); HELP <cmd> shows arity, complexity, and key specs. INFO reports memory, clients, persistence, replication; section names (server, memory, stats, replication) filter it. CONFIG GET/SET tweak runtime config (persistence-aware, but not across restarts unless you also CONFIG REWRITE). DBSIZE is O(1). Use --raw for shell-friendly output (no quoted strings).
More Redis CLI Snippets
Connecting: URLs, TLS, AUTH & Select
Connect to standalone, TLS, authenticated, or non-default DB indexes.
MULTI / EXEC / WATCH (Transactions)
Queue commands atomically and use optimistic locking with WATCH.
Pub/Sub: SUBSCRIBE, PUBLISH & PSUBSCRIBE
Fan-out messaging with channels and pattern subscriptions.
MONITOR, SLOWLOG & Latency Debugging
Watch every command in real time and find slow queries.
EVAL, Lua & Function Stats (Server-side Scripting)
Run atomic server-side Lua scripts; load and call functions.
RDB / AOF Persistence & Backup
Trigger snapshots, manage AOF rewrite, and capture a safe backup.