أساسيات Redis CLI
تعلّموا الاتصال بـ Redis وتنفيذ الأوامر الأساسية وإدارة البيانات عبر واجهة سطر الأوامر.
أساسيات Redis CLI درس مجاني في Redis Caching & Messaging (Pub/Sub, Streams) على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في 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/7) وفتح باقي دورة 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/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Redis Caching & Messaging (Pub/Sub, Streams)؟
لا تُشترط خبرة سابقة. Redis Caching & Messaging (Pub/Sub, Streams) على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «أساسيات Redis CLI»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Redis Caching & Messaging (Pub/Sub, Streams) هذا؟
نعم. كل درس في Redis Caching & Messaging (Pub/Sub, Streams) يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- مقدمة إلى Redis
- أساسيات Redis CLI
- هياكل البيانات الأساسية في Redis
- انتهاء صلاحية المفاتيح وTTL في Redis