Redis CLI の基礎
Redis への接続、基本コマンドの実行、コマンドラインインターフェースを使ったデータ管理を学びます。
「Redis CLI の基礎」はCoddyKit上の無料Redis Caching & Messaging (Pub/Sub, Streams)レッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはRedis Caching & Messaging (Pub/Sub, Streams)学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Redis Caching & Messaging (Pub/Sub, Streams)コースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
What is Redis CLI?
The redis-cli lets you talk to your Redis server directly — perfect for quick tests, debugging, and admin without writing any app code.
Connecting to Redis
Connect by running redis-cli in your terminal. It defaults to 127.0.0.1 on port 6379 and drops you at a prompt ready for commands.
Your First Command: PING
PING checks that the server is alive — type it and a healthy Redis replies PONG. Your simplest health check.
Storing Data: SET
SET stores a string value under a key: SET key value. Like sticking a labeled note on the fridge — the example shows it returning OK.
Retrieving Data: GET
GET retrieves a key's value: GET key. If the key doesn't exist, Redis returns (nil) instead.
Updating Values
Run SET on an existing key and it overwrites the old value — no confirmation prompt, so be careful. The example shows the value getting replaced.
Deleting Data: DEL
DEL removes one or more keys: DEL key [key ...]. It returns how many keys were actually deleted.
Checking Key Existence: EXISTS
EXISTS tells you if a key is present without fetching its value — returning 1 if it exists, 0 if not.
Counting with INCR & DECR
Redis does counters: INCR bumps a key's integer up by one, DECR drops it by one. A missing key starts at 0 before the operation.
CLI Command Challenge
What will be the final value of the key mycounter after executing these Redis CLI commands?
SET mycounter 5
INCR mycounter
DECR mycounter
INCR mycounter
DEL mycounter
INCR mycounterRecap: Redis CLI Basics
Recap: with the redis-cli you can connect, PING, SET and GET strings, overwrite keys, DEL them, check EXISTS, and run INCR/DECR counters.
よくある質問
「Redis CLI の基礎」レッスンは無料ですか?
はい。「Redis CLI の基礎」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Redis Caching & Messaging (Pub/Sub, Streams)コースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Redis Caching & Messaging (Pub/Sub, Streams)コースには全4レッスンが含まれています。
「Redis CLI の基礎」で何を学びますか?
Redis への接続、基本コマンドの実行、コマンドラインインターフェースを使ったデータ管理を学びます。 ブラウザで直接実行するハンズオンコードでRedis Caching & Messaging (Pub/Sub, Streams)を演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Redis Caching & Messaging (Pub/Sub, Streams)を始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのRedis Caching & Messaging (Pub/Sub, Streams)は初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「Redis CLI の基礎」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このRedis Caching & Messaging (Pub/Sub, Streams)レッスンでコードを書いて実行できますか?
はい。すべてのRedis Caching & Messaging (Pub/Sub, Streams)レッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- Redis 入門
- Redis CLI の基礎
- Redis の主要なデータ構造
- Redisのキー有効期限とTTL