مهارات سطر الأوامر - الوحدة 05

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

ما هي الطريقة لعرض قائمة الأوامر السابقة في الطرفية؟

  • استخدام الأمر commands
  • استخدام الأمر log
  • استخدام الأمر show
  • استخدام الأمر history (correct)

كيف يمكن تنفيذ أمر موجود في قائمة الأوامر السابقة؟

  • باستخدام علامة التعجب ! قبل الرقم (correct)
  • باستخدام نجم * قبل الرقم
  • بكتابة رقم الأمر فقط
  • بكتابة الأمر بالكامل مرة أخرى

ماذا سيظهر عند تنفيذ الأمر history في الطرفية؟

  • إعدادات الشبكة
  • قائمة الملفات الموجودة
  • تاريخ النظام الحالي
  • قائمة الأوامر التي تم تنفيذها (correct)

ما هو الأمر لعرض التاريخ في النظام؟

<p>date (B)</p> Signup and view all the answers

ما هي نتيجة تنفيذ الأمر ls في الطرفية؟

<p>عرض محتوى الدليل الحالي (C)</p> Signup and view all the answers

ما هي ميزة استخدام واجهة الأوامر النصية (CLI) مقارنةً بالواجهات الرسومية؟

<p>قدرة أكبر على التحكم الدقيق (D)</p> Signup and view all the answers

كيف يمكن لواجهة الأوامر النصية أن تسهل الأتمتة؟

<p>من خلال استخدام السكربتات (A)</p> Signup and view all the answers

ما هي إحدى الفوائد الرئيسية لاستخدام واجهة الأوامر النصية؟

<p>تحسين سرعة تنفيذ الأوامر (D)</p> Signup and view all the answers

ما الذي يتم تمريره إلى الطرفية عند إدخال أمر؟

<p>أوامر النظام (A)</p> Signup and view all the answers

ما هو تأثير استخدام واجهة الأوامر النصية على سرعة الأداء؟

<p>يعزز من سرعة الأداء (C)</p> Signup and view all the answers

ما هو المقصود بحروف الـ Glob؟

<p>رموز لها معنى خاص للنظام (A)</p> Signup and view all the answers

أي من الرموز يعد رمز Glob؟

<ul> <li>(C)</li> </ul> Signup and view all the answers

لماذا يتم استخدام حروف الـ Glob في الشيل؟

<p>لعرض شئ عادةً ما يكون رمزاً خاصاً (A)</p> Signup and view all the answers

ما هو الأمر الذي يعرض المسار الحالي للصدفة؟

<p>echo $PATH (A)</p> Signup and view all the answers

ما هي الدالة المستخدمة لعرض المتغيرات في نظام لينكس؟

<p>echo (D)</p> Signup and view all the answers

أي من الخيارات التالية يُعتبر خطأ عن استخدام حروف الـ Glob؟

<p>يمكن استخدامها لإلغاء الأوامر (B)</p> Signup and view all the answers

أي من الخيارات التالية ليس جزءًا من المسار $PATH المعروض؟

<p>/usr/local/games (A)</p> Signup and view all the answers

أي من الرموز التالية يُعتبر رمز Glob أيضًا؟

<p>؟ (B)</p> Signup and view all the answers

ماذا يسمى الحرف المستخدم للإشارة إلى أنماط بواسطة 'globbing'؟

<p>أحرف شائعة (D)</p> Signup and view all the answers

أي مما يلي يعتبر صحيحًا بشأن المتغير $PATH؟

<p>$PATH يستخدم للبحث عن الأوامر (A)</p> Signup and view all the answers

ماذا يفعل أمر ls عند إعطائه اسم دليل كوسيلة جلب؟

<p>يعرض محتويات الدليل (B)</p> Signup and view all the answers

ما هي صيغة الأوامر التي يتم استخدامها في سطر الأوامر؟

<p>اسم الأمر [الخيارات] [الوسائط] (B)</p> Signup and view all the answers

أي من الخيارات التالية يعد استخدامًا صحيحًا لأمر ls؟

<p>ls -a /etc/ppp (A), ls /etc/ppp /etc/ssh (C)</p> Signup and view all the answers

ما الهدف من استخدام الخيارات مع الأوامر؟

<p>لتعديل أو توسيع سلوك الأمر (C)</p> Signup and view all the answers

ما هو الناتج المتوقع عند تنفيذ الأمر ls في الدليل /etc/ppp؟

<p>ip-down.d و ip-up.d (B)</p> Signup and view all the answers

ما الذي يحدث عندما يتم استخدام $1 و $PATH في العبارة المحددة؟

<p>$1 يتم تجاهله و $PATH يتم تفسيره كمتغير (B)</p> Signup and view all the answers

كيف يمكنك جعل $PATH يتم تفسيره كمتغير بينما لا يتم تفسير $1؟

<p>بوضع العبارة في علامات تنصيص مفردة (C)</p> Signup and view all the answers

ما النتيجة عند استخدام الأمر التالي: echo "The service costs $1 and the path is $PATH"؟

<p>ستخبر المستخدم أن الخدمة تكلف و الطريق هو (C)</p> Signup and view all the answers

ما هي القيمة التي سيظهرها $PATH إذا كان مستخدمًا في الأمر المذكور؟

<p>/usr/bin/custom:/home/sysadmin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games (C)</p> Signup and view all the answers

ما الذي سيحدث إذا تم استخدام $1 و $PATH في علامات تنصيص مزدوجة؟

<p>سيتم تفسير كلا المتغيرين (C)</p> Signup and view all the answers

Flashcards

أمر ls

أمر يُستخدم لعرض محتويات دليل معين.

المسار الكامل للدليل

المسار الكامل للدليل الذي تريد عرض محتوياته.

الخيارات

خيارات إضافية تُستخدم لتعديل سلوك الأمر.

أوامر متعددة الوسائط

أوامر يمكنها تلقي أكثر من وسيطة.

Signup and view all the flashcards

محتويات الدليل

قائمة من الملفات أو الدلائل الموجودة داخل الدليل.

Signup and view all the flashcards

أمر history

عرض قائمة أوامر سطر الأوامر السابقة.

Signup and view all the flashcards

أمر history

يعرض قائمة أوامر سطر الأوامر السابقة التي تم تنفيذها.

Signup and view all the flashcards

إعادة تنفيذ أمر من قائمة history

لإعادة تنفيذ أمر من قائمة history ، اكتب علامة تعجب (!) ثم رقم الأمر من القائمة.

Signup and view all the flashcards

علامة تعجب (!)

يُمكن استخدامه لإعادة تنفيذ أي أمر من قائمة history من خلال كتابة !.

Signup and view all the flashcards

رقم الأمر من قائمة history

يُمكن استخدام رقم الأمر من قائمة history لإعادة تنفيذه من جديد.

Signup and view all the flashcards

نظام الأوامر

نظام الأوامر هو واجهة سطر الأوامر (CLI) التي تسمح للمستخدمين بالتفاعل مع نظام التشغيل عن طريق كتابة الأوامر.

Signup and view all the flashcards

الأوامر في نظام الأوامر

الأوامر المكتوبة في نظام الأوامر هي عبارة عن سلسلة من الأحرف تُفهم من قبل نظام التشغيل.

Signup and view all the flashcards

أهداف أوامر نظام الأوامر

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

Signup and view all the flashcards

مزايا نظام الأوامر

يمكن استخدام نظام الأوامر للقيام بأشياء معقدة ، القيام بمهام روتينية متكررة ، وتنفيذ سلاسل متعددة من الأوامر تلقائيًا.

Signup and view all the flashcards

بناء جملة أوامر نظام الأوامر

تعتمد الأوامر في نظام الأوامر على بناء جملة محددة، ويشمل ذلك استخدام رموز معينة وترتيب محدد للحجج.

Signup and view all the flashcards

الحرف البري

رموز خاصة تستخدمها قشرة النظام (مثل * و ؟) للبحث عن ملفات أو أوامر. فهي تساعد في العثور على ملفات أو أوامر تتناسب مع نمط معين.

Signup and view all the flashcards

استخدام حروف البري

تستخدم حروف البري في قشرة النظام للبحث عن ملفات أو أوامر تتناسب مع نمط معين.

Signup and view all the flashcards

علامة الاستفهام (?)

حرف بري يمثل أي حرف أو رقم.

Signup and view all the flashcards

علامة النجمة (*)

حرف بري يمثل سلسلة من الحروف أو الأرقام.

Signup and view all the flashcards

إظهار الحرف البري على الشاشة

لإظهار حرف بري على الشاشة بدلاً من تنفيذ وظيفته، يمكنك وضع حرف مائل أمام حرف بري. مثال: "*"

Signup and view all the flashcards

مسار shell الحالي

مسار shell الحالي هو متغير بيئي يُعبّر عن مجموعة من الدلائل التي يبحث عنها النظام عند تنفيذ الأوامر.

Signup and view all the flashcards

أوامر shell

أوامر shell هي مجموعة من التعليمات التي نفّذها shell لإنجاز مهمة معينة.

Signup and view all the flashcards

echo $PATH

echo $PATH هو أمر shell يستخدم لعرض قيمة متغير بيئي PATH

Signup and view all the flashcards

PATH

PATH هو متغير بيئي يحدد مجموعة الدلائل التي يبحث عنها shell عن الأوامر التنفيذية.

Signup and view all the flashcards

: في PATH

: أحد الرموز المستخدمة لفصل الدلائل المختلفة في PATH

Signup and view all the flashcards

نص بين علامتي اقتباس مفردة

عندما يتم وضع النص بين علامتي اقتباس مفردة، فإن المتغيرات مثل $1 و $PATH لا يتم التعامل معها كمتغيرات. بدلاً من ذلك، تُعامل على أنها نص عادي.

Signup and view all the flashcards

متغير PATH

هو عامل بيئي يحتوي على قائمة من المسارات التي يبحث فيها نظام التشغيل عن الملفات التنفيذية.

Signup and view all the flashcards

متغير $PATH

نهاية المسار

Signup and view all the flashcards

متغير $1

في سطر الأوامر، يُستخدم المتغير '$1' لتمثيل الحجة الأولى التي تمرر إلى الأمر.

Signup and view all the flashcards

طريقة التعامل مع $1 و $PATH كمتغيرات

للحفاظ على '$PATH' كمتغير، و $1 كنص عادي، يمكن استخدام علامتي اقتباس مفردة لـ $1 و علامتي اقتباس مزدوجة لـ $PATH.

Signup and view all the flashcards

Study Notes

Module 05: Command Line Skills

  • This module covers the basics of the command line interface (CLI), including the shell, commands, variables, command types, quoting, and control statements.
  • The Linux community promotes the CLI for its power, speed, and ability to accomplish tasks with single commands, especially for server environments that do not require graphical interfaces.
  • The CLI provides precise control, speed, and easier automation through scripting. This makes Linux users highly productive almost instantly.

Command Line Interface

  • The CLI is a powerful tool for interacting with a computer's operating system.
  • It allows users to perform tasks via commands rather than a graphical user interface.
  • The CLI is beneficial for tasks that require precise control or speed.

The Shell

  • The shell is a command-line interpreter which converts commands typed by the user to actions performed by the operating system.
  • It's a crucial part of the CLI.
  • Linux allows many different shells, and the most common is the Bash shell. This shell has features such as command history, inline editing, scripting, aliases, and variables for storing information for the shell and the user itself, enabling many commands to be completed.

The Prompt

  • The prompt displays information about the user and system.
  • A typical structure includes username, system name(hostname), and current directory. The ~ symbol represents the user's home directory.

Commands

  • A command is a software program that executes an action on the computer when run in the CLI
  • To execute a command, type its name and press Enter.
  • Some commands require additional input like options and arguments to work correctly.

Arguments

  • Used to specify what the command should act upon.
  • For example, if ls (list directory contents) is given a directory name as an argument, it lists that directory.
  • Some commands may accept multiple arguments.

Options

  • Options modify how commands behave.
  • They often use single letters (e.g., -l for a long listing) or complete words (e.g., --help).
  • Options can be used in conjunction with each other.

Commands Types

  • Commands are categorized as internal (built-in) or external (stored elsewhere).
  • Using the type command, you can find out a command's type.

Internal Commands

  • These commands are built into the shell.
  • cd (change directory) and ls (list directory contents) are examples.

External Commands

  • These are commands stored in files.
  • You can use which to find the location of an external command. The location is stored in an environment variable called the PATH variable, a very important variable, which contains a list of directories where the system looks for programs.

Aliases

  • An alias creates a shortcut for a longer command.
  • You can set aliases using the alias command.
  • You can delete an alias using the unalias command.

Functions

  • Functions let you group several commands into a single command.
  • They are often loaded from shell initialization files when the shell starts up.

Variables

  • Variables are used to store data.
  • There are two types: local (temporal/lost when the terminal is closed) and environment (global/system wide.)

Globbing

  • Glob characters (wildcards like * and ?) are symbols with special meaning in the shell.
  • They can be used as patterns to match filenames.
  • Using glob characters, you can control commands and affect multiple files at once.

Quoting

  • Quoting characters (", ') prevent the shell from interpreting special characters in the string.
  • " (double quotes) stop the shell from interpreting special characters in strings.
  • ' (single quotes) stop the shell from interpreting special characters at all, including glob characters.
  • \ (backslash) can be used to escape special characters in the string.

Control Statements

  • Control statements allow for running multiple commands simultaneously or conditionally.
  • Important control statements include semicolon (;), double ampersand (&&) and double pipe (||).

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Bash Shell Grundlagen
10 questions

Bash Shell Grundlagen

AdoringClavichord avatar
AdoringClavichord
Linux Shell Flashcards
39 questions

Linux Shell Flashcards

MarvelousPascal avatar
MarvelousPascal
Use Quizgecko on...
Browser
Browser