Course / دورة
The operating system and the Terminalنظام التشغيل والطرفية
Basic commands, managing files, and the environment you work in
أوامر أساسية، وإدارة الملفات، والبيئة التي تعمل فيها
beginner 23 lessons 7 chapters 12 hours
0 / 23 lessons completed / دروس مكتملة
What you will be able to do / ماذا ستستطيع أن تفعل
- Move around a machine and manage files without a mouse تتنقل في الجهاز وتدير الملفات دون فأرة
- Join small commands into one that does the job تربط أوامر صغيرة في أمر واحد ينجز المهمة
- Understand permissions, paths and environment variables تفهم الصلاحيات والمسارات ومتغيرات البيئة
- Connect to a server over SSH and work on it تتصل بخادم عبر SSH وتعمل عليه
1 Why a terminal at allلماذا الطرفية أصلًا 2
-
1
What an operating system actually does / ما الذي يفعله نظام التشغيل فعلًا
Before any command makes sense, it helps to know what is on the other side of it. An operating system is a program whose whole job is sharing one machine between everything that wants it.
قبل أن يصير أي أمر مفهومًا، يفيد أن تعرف ما الذي على الطرف الآخر منه. فنظام التشغيل برنامج كل عمله تقاسم جهاز واحد بين كل ما يريده.
-
2
Why a terminal, and how to open one / لماذا الطرفية، وكيف تفتح واحدة
The window is not the point. Behind it sits a program that reads a line, runs it and waits for the next — and that arrangement can do things no amount of clicking can.
النافذة ليست المقصود. فخلفها برنامج يقرأ سطرًا وينفّذه وينتظر التالي — وهذا الترتيب يستطيع ما لا يستطيعه أي قدر من النقر.
2 Moving aroundالتنقّل 3
-
3
Your first commands: pwd, ls, cd / أوامرك الأولى: pwd وls وcd
Three commands answer the only questions that matter at the start: where am I, what is here, and how do I go somewhere else. Everything later assumes these are automatic.
ثلاثة أوامر تجيب الأسئلة الوحيدة المهمة في البداية: أين أنا، وما الموجود هنا، وكيف أذهب إلى مكان آخر. وكل ما بعدها يفترض أنها صارت تلقائية.
-
4
Paths: absolute, relative, and the shortcuts / المسارات: المطلق والنسبي والاختصارات
Every command that touches a file needs to be told which one. There are two ways to say it, and knowing which you are using is the difference between a command that works anywhere and one that only works where you happen to be standing.
كل أمر يمسّ ملفًا يحتاج أن يُقال له أيّه. وثمة طريقتان لقول ذلك، ومعرفة أيهما تستخدم هي الفرق بين أمر يعمل في أي مكان وأمر لا يعمل إلا حيث تقف.
-
5
Looking inside files / النظر داخل الملفات
Four commands for reading a file without opening an editor — and the reason there are four is that a log with two million lines needs different handling from a note with six.
أربعة أوامر لقراءة ملف دون فتح محرر — وسبب كونها أربعة أن سجلًا بمليوني سطر يحتاج معاملة غير التي تحتاجها مذكرة بستة أسطر.
3 Working with filesالتعامل مع الملفات 6
-
6
Creating and removing / الإنشاء والحذف
Making a file or a folder takes one short command. Removing one takes another — and that second command deserves more respect than any other in this course, because there is no undo.
إنشاء ملف أو مجلد يحتاج أمرًا قصيرًا واحدًا. وحذفه يحتاج آخر — وذلك الأمر الثاني يستحق احترامًا أكثر من أي أمر آخر في هذه الدورة، لأنه لا تراجع.
-
7
Copying, moving and renaming / النسخ والنقل وإعادة التسمية
Two commands cover three jobs, because moving a file and renaming it turn out to be the same operation — and both will overwrite something without asking if you let them.
أمران يغطيان ثلاثة أعمال، لأن نقل الملف وإعادة تسميته يتبيّن أنهما العملية نفسها — وكلاهما يستبدل بشيء دون سؤال إن تركته.
-
8
Finding files / العثور على الملفات
You know a file exists and not where it is. One command searches the tree by name, size or age — and it is the first command in this course whose arguments read like a sentence.
تعرف أن ملفًا موجود ولا تعرف أين. وأمر واحد يبحث في الشجرة بالاسم أو الحجم أو العمر — وهو أول أمر في هذه الدورة تُقرأ وُسَطاؤه كأنها جملة.
-
9
Searching inside files with grep / البحث داخل الملفات بـgrep
The previous lesson found files by their names. This one finds them by what is written inside them — which is how you answer "where on earth is that string coming from?"
الدرس السابق وجد الملفات بأسمائها. وهذا يجدها بما هو مكتوب بداخلها — وهكذا تجيب سؤال "من أين يأتي هذا النص أصلًا؟"
-
10
Permissions: rwx, and why 644 and 755 / الصلاحيات: rwx ولماذا 644 و755
That column of letters in
ls -ldecides who may read, change and run every file on the machine. Two numbers cover almost every case you will meet on a web server.عمود الحروف ذاك في
ls -lيقرر من يجوز له قراءة كل ملف على الجهاز وتغييره وتشغيله. ورقمان يغطيان كل حالة تقريبًا ستقابلها على خادم ويب. -
11
Hidden files, links and file types / الملفات المخفية والوصلات وأنواع الملفات
Some of the most important files on your machine are invisible by default, some names are signposts to other files, and the extension on the end is not what decides what a file is.
بعض أهم الملفات على جهازك خفية افتراضيًا، وبعض الأسماء لافتات تشير إلى ملفات أخرى، والامتداد في الآخر ليس هو ما يحدد ما الملف.
4 Joining commands togetherربط الأوامر 4
-
12
Wildcards: naming many files at once / البدائل: تسمية ملفات كثيرة دفعة واحدة
A star in a filename is not passed to the command. The shell expands it into a list of real names first, and understanding that one fact explains several things that otherwise look like magic.
النجمة في اسم ملف لا تُمرَّر إلى الأمر. بل توسّعها الـshell إلى قائمة بأسماء حقيقية أولًا، وفهم تلك الحقيقة وحدها يفسّر أشياء عدة تبدو بغيرها سحرًا.
-
13
Redirection: sending output somewhere else / إعادة التوجيه: إرسال المخرَج إلى مكان آخر
Every command writes to somewhere and reads from somewhere, and both ends can be repointed with a single character. One of those characters silently empties an existing file.
كل أمر يكتب إلى موضع ويقرأ من موضع، ويمكن إعادة توجيه الطرفين بمحرف واحد. وأحد تلك المحارف يُفرِغ ملفًا موجودًا بصمت.
-
14
Pipes: making commands work together / الأنابيب: جعل الأوامر تعمل معًا
The previous lesson sent output to a file. Send it to another command instead and you can build a tool that nobody wrote, out of parts that each do one small thing.
أرسل الدرس السابق المخرَج إلى ملف. أرسله إلى أمر آخر بدلًا من ذلك فتستطيع بناء أداة لم يكتبها أحد، من أجزاء يفعل كل منها شيئًا صغيرًا واحدًا.
-
15
Quoting, spaces and escaping / الاقتباس والمسافات والتهريب
The shell splits your line on spaces before anything runs. Every quoting rule in this lesson exists to control that split — and to stop a filename with a space in it becoming two arguments.
تقسّم الـshell سطرك عند المسافات قبل تنفيذ أي شيء. وكل قاعدة اقتباس في هذا الدرس وُجدت للتحكم في ذلك التقسيم — ولمنع اسم ملف فيه مسافة من أن يصير وسيطين.
5 The environmentالبيئة 4
-
16
Environment variables / متغيّرات البيئة
Every program you start inherits a set of named values from the shell. They are how a program is told where things are, which language you read, and — badly — where the passwords are.
كل برنامج تشغّله يرث مجموعة من القيم المسمّاة من الـshell. وبها يُخبَر البرنامج أين الأشياء، وبأي لغة تقرأ، و— على نحو سيئ — أين كلمات المرور.
-
17
Where a command comes from / من أين يأتي الأمر
You type
phpand something runs. Which something is decided by one variable, searched left to right — and that search explains almost every "wrong version" problem you will hit.تكتب
phpفيعمل شيء. وأي شيء يقرره متغيّر واحد يُبحث فيه من اليسار لليمين — وذلك البحث يفسّر كل مشكلة "النسخة الخطأ" تقريبًا ستقابلها. -
18
Startup files: making it stick / ملفات البدء: جعل الإعداد يدوم
Everything you set in a terminal disappears when you close it. One hidden file in your home directory is read at the start of every new shell, and that is where a setting goes to survive.
كل ما تضبطه في طرفية يختفي حين تغلقها. وملف مخفي واحد في مجلد منزلك يُقرأ عند بدء كل shell جديدة، وهناك يذهب الإعداد لينجو.
-
19
Processes and jobs / العمليات والمهام
Every running program is a process with a number. Knowing how to list them, stop them politely and stop them rudely is what turns "my machine is stuck" into a diagnosis.
كل برنامج عامل عملية لها رقم. ومعرفة كيف تسردها وتوقفها بأدب وتوقفها بفظاظة هي ما يحوّل "جهازي عالق" إلى تشخيص.
6 Beyond your machineخارج جهازك 3
-
20
Package managers and versions / مديرو الحزم والنسخ
Installing software from the terminal is one command. The harder question is which version you end up with, and what happens when a project needs a different one from the one you have.
تثبيت البرامج من الطرفية أمر واحد. والسؤال الأصعب هو أي نسخة تنتهي إليها، وماذا يحدث حين يحتاج مشروع نسخة غير التي عندك.
-
21
Connecting to a server with ssh / الاتصال بخادم عبر ssh
Everything you have learned works unchanged on a machine in another country. One command opens a shell there, and the same commands you have been typing all course apply.
كل ما تعلمته يعمل دون تغيير على جهاز في بلد آخر. وأمر واحد يفتح shell هناك، وتنطبق الأوامر نفسها التي كنت تكتبها طوال الدورة.
-
22
Editing a file on a server / تعديل ملف على خادم
There is no graphical editor on the other end of an
sshconnection. You need enough of one terminal editor to change a line and save — and enough of the other to escape it.لا محرر رسومي على الطرف الآخر من اتصال
ssh. وتحتاج من محرر طرفية ما يكفي لتغيير سطر وحفظه — ومن الآخر ما يكفي للهروب منه.