انتقل إلى المحتوى
أمين أبوزيد
BEG-006

سطر الأوامر

  • 8 درس
  • 88 دقيقة قراءة
  • 3 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • الطرفية (Terminal)
  • الصدفة (shell)
  • المجلدات
  • أوامر الملفات
  • المسارات
  • الصلاحيات
  • متغيرات البيئة
  • الأنابيب (pipes)
  • إعادة التوجيه
  • أساسيات Bash/PowerShell

تعلّم أولًا

88 دقيقة قراءة · 3 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Navigate directories with absolute and relative paths (pwd, cd, ls/dir).
  2. Create, copy, move, and delete files and folders from the terminal.
  3. Use pipes and redirection to filter output and save it to a file.
  4. Read and set an environment variable for the current session in Bash and PowerShell.
  5. Explain file permissions at a basic level and why a script may fail to execute.

الدروس

  1. 01الطرفية والصدفة ومحث الأوامر12 د قراءة
  2. 02المسارات: المطلق والنسبي والرئيسي و. و..11 د قراءة
  3. 03التعامل مع الملفات والمجلدات10 د قراءة
  4. 04الأنابيب وإعادة التوجيه10 د قراءة
  5. 05متغيرات البيئة في الصدفة11 د قراءة
  6. 06أساسيات الصلاحيات12 د قراءة
  7. 07ورقة مرجعية: Bash مقابل PowerShell11 د قراءة
  8. 08عرض عملي: إعداد مجلد مشروع باستخدام الطرفية فقط11 د قراءة

المختبر والتمارين

Lab

BEG-006-LAB1 · Terminal-only project setup

Outcomes: 1–5 · Time: ~2 h Using only the terminal: create a project folder structure, create files, list them sorted by size, save the listing to a file, and search it for a word. Acceptance: a command history file plus the final folder tree.

Exercises

IDOutcomeTask
BEG-006-EX011From your home folder, go into Documents, then back up two levels using relative paths.
BEG-006-EX021Print your current folder, then the same location as an absolute path.
BEG-006-EX032Create a/b/c, create a file in c, copy it to b, move the original to a.
BEG-006-EX042Delete the whole a folder you made, after checking where you are.
BEG-006-EX053Save a folder listing to list.txt and show only the lines containing a chosen word.
BEG-006-EX064Set a variable COURSE=java for this session and print it.
BEG-006-EX075Make a script file executable and run it. What happens before and after?
أظهر الحلول
  • EX01 cd Documents then cd ../...
  • EX02 pwd (Bash) or Get-Location (PowerShell).
  • EX03 mkdir -p a/b/c; touch a/b/c/f.txt; cp a/b/c/f.txt a/b; mv a/b/c/f.txt a.
  • EX04 pwd first, then rm -r a.
  • EX05 ls > list.txt then grep word list.txt.
  • EX06 export COURSE=java; echo $COURSE (PowerShell: $env:COURSE = "java"; $env:COURSE).
  • EX07 Before: "Permission denied". After chmod +x script.sh: it runs.

الاختبار

Outcomes: O1 paths · O2 files · O3 pipes · O4 variables · O5 permissions.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1cd .. moves you to:O1
  2. 2An absolute path:O1
  3. 3pwd shows:O1
  4. 4Which command copies a file in Bash?O2
  5. 5Deleting from the terminal:O2
  6. 6> does what?O3
  7. 7| (pipe) does what?O3
  8. 8Which sets a variable for the current session in Bash?O4
  9. 9In PowerShell, you read variable X with:O4
  10. 10"Permission denied" when running a script usually means:O5

الجزء العملي

Timed terminal task: 10 commands (navigate, create, copy, move, redirect, filter, set a variable) with no GUI use, 15 minutes. Pass: at least 8 of 10 correct.

أخطاء شائعة

Spaces in paths without quotes; running rm/del without checking the current directory; mixing Bash and PowerShell syntax.

التقييم

Timed terminal task (10 commands) with no GUI use.

الصلة بالمسار الوظيفي

Daily tool from here on; deepened in JNR-048.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.