Redis46 commands
Redis Cheat Sheet
Essential Redis commands for strings, hashes, lists, sets, pub/sub, TTLs, and cluster management.
Connection & Server
| Command | Description |
|---|---|
| Connect to local Redis |
| Connect to remote Redis |
| Check if server is alive |
| Server info and statistics |
| Memory usage details |
| Number of keys in current DB |
| Delete all keys in current DB |
| Switch to database 1 |
| Get config value |
Strings
| Command | Description |
|---|---|
| Set a key |
| Get a key's value |
| Set with 1-hour TTL |
| Set only if key doesn't exist |
| Set multiple keys |
| Get multiple keys |
| Increment integer value |
| Increment by specific amount |
| Append to string value |
Hashes
| Command | Description |
|---|---|
| Set hash fields |
| Get single hash field |
| Get all hash fields and values |
| Delete hash field |
| Increment hash field |
| Check if hash field exists |
Lists & Sets
| Command | Description |
|---|---|
| Push to left of list |
| Pop from right of list |
| Get all list elements |
| List length |
| Add to set |
| Get all set members |
| Check set membership |
| Set intersection |
Keys & TTL
| Command | Description |
|---|---|
| Find keys by pattern |
| Iterate keys (production-safe) |
| Check if key exists |
| Delete key |
| Set TTL (5 minutes) |
| Check remaining TTL |
| Remove TTL |
| Get key's data type |
| Rename a key |
Pub/Sub & Streams
| Command | Description |
|---|---|
| Publish message to channel |
| Subscribe to channel |
| Add entry to stream |
| Read from stream |
| Stream length |