0Pricing
Linux Command Line Mastery · درس

إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv`

أتقن إنشاء الملفات والأدلة وحذفها ونسخها ونقلها بكفاءة.

إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv` درس مجاني في Linux Command Line Mastery على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Linux Command Line Mastery، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Linux Command Line Mastery 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Mastering File Management

Managing files is a core shell skill. This lesson covers the four essentials: mkdir, cp, mv, and rm — create, copy, move, delete.

Creating Folders with `mkdir`

mkdir (make directory) creates a new folder — just give it a name. Try making one called my_documents.

mkdir my_documents

Advanced `mkdir` Usage

Create several folders at once by listing names. Add -p to build nested directories, creating any missing parents along the way.

mkdir reports project/src/main -p

Copying Files with `cp`

cp (copy) duplicates a file: give it a source and a destination. Here we use touch to make a file first, then copy it.

touch notes.txt
cp notes.txt backup_notes.txt

Copying Folders with `cp -r`

To copy a whole folder, add -r (recursive) so cp grabs the directory and everything inside. Without it, folders are skipped.

mkdir data_folder
touch data_folder/file_a.txt
cp -r data_folder archived_data

Moving Files with `mv`

mv (move) relocates files or folders — like cut and paste. Point it at a source and a destination directory.

touch document.pdf
mkdir important_files
mv document.pdf important_files/

Renaming Files & Folders

Bonus: mv also renames. Move a file to the same place with a new name, and you’ve renamed it.

touch old_report.txt
mv old_report.txt new_report.txt

Deleting Files with `rm`

rm (remove) deletes files — permanently, with no trash to recover from. Always double-check what you’re removing.

touch unwanted.txt
rm unwanted.txt

Deleting Folders with `rm -r`

To delete a non-empty folder, add -r so rm clears the directory and its contents. Extreme caution — this is irreversible.

mkdir empty_folder
rm -r empty_folder

Quick Check: File Management

Imagine you have a file named draft.txt in your current directory. You want to create a new folder called final_docs and then move draft.txt into it, renaming it to final_report.txt in the process. Which sequence of commands would achieve this?

Lesson Summary

Great work! You’ve got file management down: mkdir to create, cp to copy, mv to move or rename, and rm to delete (with -r for folders).

الأسئلة الشائعة

هل درس «إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv`» مجاني؟

نعم — نص درس «إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv`» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Linux Command Line Mastery، انتقل إلى CoddyKit PRO. تتضمن دورة Linux Command Line Mastery 4 دروس في المجموع.

ماذا ستتعلم في «إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv`»؟

أتقن إنشاء الملفات والأدلة وحذفها ونسخها ونقلها بكفاءة. تتمرن على Linux Command Line Mastery مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Linux Command Line Mastery؟

لا تُشترط خبرة سابقة. Linux Command Line Mastery على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv`»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Linux Command Line Mastery هذا؟

نعم. كل درس في Linux Command Line Mastery يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. مقدمة إلى Linux Shell
  2. التنقّل الأساسي: `cd` و`ls` و`pwd`
  3. إدارة الملفات والأدلة: `mkdir` و`rm` و`cp` و`mv`
  4. الحصول على المساعدة: man و--help وtldr
← العودة إلى Linux Command Line Mastery