跳转到主要内容
kitlocal.dev

Redis 命令速查

本地运行

100% 在你的浏览器中处理。输入和输出绝不会离开你的设备。

可搜索的 Redis 命令参考,附示例。

工作原理

Redis is a single-threaded in-memory data-structure store: choose atomic O(1)/O(log N) operations per type, always prefer `SCAN`/`HSCAN`/`SSCAN`/`ZSCAN` over blocking `KEYS *`, and cap hot keys with TTL.

生存指南

最先需要掌握的少数几个命令。

43 条命令

键盘快捷键/聚焦搜索框JK移动选择C复制选中命令F收藏选中项Esc清空搜索

Keys, TTL & Strings

Store caches, distribute atomic locks (`SET ... NX EX`), counters, and expire keys.

  • 基础必备

    Verify Redis connectivity and measure round-trip liveness (`PONG`)

    PING [message]

    适用场景

    Standard healthcheck command returning `PONG` (or echoing optional message).

    示例

    PING

    运行结果

    PONG

Hashes & Lists

Model multi-field objects compactly with Hashes and build FIFO queues/caps with Lists.

Sets, Sorted Sets & HyperLogLog

Track unique members, leaderboards, sliding-window rate limits, and cardinality.

Streams, Pub/Sub & Transactions

Publish realtime messages, consume persistent streams, and run atomic MULTI/EXEC.

Non-Blocking Scan, Memory & Ops

Inspect keys safely in production, check slow logs, memory usage, and persistence.

在 KitLocal 工具中试用

核对时间:2026年11月15日 · 核对版本:Redis 7.x CLI & Core Data Structures

来源: Redis Commands Reference · Redis Data Types Guide

请将尖括号内的内容替换为你自己的实际值。所有命令均来自官方文档,示例均在标明版本上实测运行。