مراقبة موارد النظام: `df` و`du` و`free`
تحقّق من مساحة القرص وأحجام الأدلة واستخدام الذاكرة للحفاظ على تحسين أداء نظامك.
مراقبة موارد النظام: `df` و`du` و`free` درس مجاني في Linux Command Line Mastery على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Linux Command Line Mastery، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Linux Command Line Mastery 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Why Monitor System Resources?
Keeping an eye on your system's resources is crucial for smooth operation. Just like a car needs fuel and oil, your computer needs enough disk space and memory to run efficiently.
Ignoring these can lead to slow performance, crashes, or even data loss.
Check Disk Space with `df`
The df command, short for "disk free", reports the amount of available disk space used by file systems.
It's your go-to command to see how much room is left on your partitions.
`df` Command in Action
Let's try df with the -h option for human-readable output. This makes sizes like gigabytes (GB) and megabytes (MB) easy to understand.
Run this command in your terminal:
df -hInterpreting `df` Results
The output of df -h shows several columns:
- Filesystem: The name of the disk partition.
- Size: Total capacity of the partition.
- Used: Space currently occupied.
- Avail: Remaining free space.
- Use%: Percentage of disk space used.
- Mounted on: Where the filesystem is accessible in the directory tree.
Disk Usage with `du`
While df shows overall disk free space, du ("disk usage") estimates file space usage, primarily for specific files or directories.
It helps you find out which folders are taking up the most space.
`du` on a Directory
To see the total size of a directory in a human-readable format, use -s (summary) and -h (human-readable) with du. Replace /var/log with any directory you want to check.
du -sh /var/logDetailed `du` Output
Want to see the size of subdirectories within a folder? Use --max-depth=N to limit the depth of the output. Here, we'll see direct subdirectories (depth 1).
du -h --max-depth=1 /home/userMonitor Memory with `free`
Memory (RAM) is vital for your system's speed. The free command displays the total amount of free and used physical and swap memory in the system.
Keeping an eye on free memory helps prevent slowdowns.
`free -h` in Practice
Similar to df, using the -h option with free provides output that's much easier to read. It shows memory in KB, MB, or GB.
free -hResource Monitoring Check
You're running low on disk space and want to find which large directories are consuming it. Which command is best suited for this task?
Recap: System Resources
Great job! In this lesson, you learned how to monitor your Linux system's vital resources:
df: Check overall disk free space.du: Estimate disk usage for files and directories.free: Monitor physical and swap memory usage.
These commands are essential tools for maintaining a healthy and optimized system!
تعلم Linux Command Line Mastery مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 12
- الدروس
- 48
الأسئلة الشائعة
هل درس «مراقبة موارد النظام: `df` و`du` و`free`» مجاني؟
نعم — نص درس «مراقبة موارد النظام: `df` و`du` و`free`» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Linux Command Line Mastery، انتقل إلى CoddyKit PRO. تتضمن دورة Linux Command Line Mastery 4 دروس في المجموع.
ماذا ستتعلم في «مراقبة موارد النظام: `df` و`du` و`free`»؟
تحقّق من مساحة القرص وأحجام الأدلة واستخدام الذاكرة للحفاظ على تحسين أداء نظامك. تتمرن على Linux Command Line Mastery مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Linux Command Line Mastery؟
لا تُشترط خبرة سابقة. Linux Command Line Mastery على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.
كم من الوقت يستغرق درس «مراقبة موارد النظام: `df` و`du` و`free`»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Linux Command Line Mastery هذا؟
نعم. كل درس في Linux Command Line Mastery يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- فهم العمليات: `ps` و`top` و`htop`
- إدارة العمليات: `kill` و`bg` و`fg`
- مراقبة موارد النظام: `df` و`du` و`free`
- أولويات العمليات باستخدام nice وrenice والإشارات