Product SiteDocumentation Site

B.2. تنظيم البنية الشجرية لنظام الملفات

B.2.1. المجلد الجذر (Root)

نظام دبيان منظم وفق معيار البنية الشجرية لنظام الملفات File Hierarchy Standard‏ (FHS). يحدد هذا المعيار الغرض من كل مجلد. مثلا، المجلدات في المستوى الأعلى موصوفة كما يلي:
  • /bin/: البرامج الأساسية؛
  • /boot/: النواة لينكس وملفات أخرى تحتاجها أثناء عملية الإقلاع المبكرة؛
  • /dev/: ملفات الأجهزة؛
  • /etc/: ملفات الإعدادات؛
  • /home/: ملفات المستخدمين الشخصية؛
  • /lib/: المكتبات الأساسية؛
  • /media/*: نقاط ربط للأجهزة النقالة (الأقراص الليزرية، مفاتيح USB وغيرها)؛
  • /mnt/: نقاط ربط مؤقتة؛
  • /opt/: تطبيقات إضافية تقدمها أطراف ثالثة؛
  • /root/: ملفات مدير النظام (المستخدم الجذر) الشخصية؛
  • /run/: volatile runtime data that does not persist across reboots;
  • /bin/: برمجيات النظام؛
  • /srv/: بيانات تستخدمها المخدّمات التي يستضيفها النظام؛
  • /tmp/: ملفات مؤقتة؛ غالبًا ما يُفرَّغ هذا المجلد عند الإقلاع؛
  • /usr/: التطبيقات؛ هذا المجلد مقسَّم إلى bin، ‏sbin،‏ lib (وفقاً للأسلوب نفسه المتَّبع في المجلد الجذر نفسه). بالإضافة لذلك، يحوي المجلد /usr/share/ بيانات مستقلة عن المعمارية. والمجلد /usr/local/ مخصص ليستخدمه مدير النظام لتثبيت البرامج يدويًا دون الكتابة فوق الملفات التي يديرها نظام الحزم (dpkg).
  • /var/: بيانات متغيرة تتحكم بها الخدمات. منها ملفات السجلات (log files)، والأرتال (queues)، و spools، والمخابئ (caches) وهكذا.
  • /proc/ و /sys/ مخصصة للنواة لينكس (وليست جزءاً من معيار FHS). تستخدم النواة هذين المجلدين لتصدير البيانات إلى فضاء المستخدم (انظر التوضيحات حول هذا المفهوم في قسم B.3.4, “فضاء المستخدم” وقسم B.5, “فضاء المستخدم”).
Note that many modern distributions, Debian included, are shipping /bin, /sbin and /lib as symlinks to the corresponding directories below /usr so that all programs and libraries are available in a single tree. It makes it easier to protect the integrity of the system files, and to share those system files among multiple containers, etc.

B.2.2. مجلد بيت المستخدم (Home)

إن محتويات مجلد بيت المستخدم غير مقيدة بمعيار، لكن توجد بعض العادات الجديرة بالذكر. أحدها أن مجلد بيت المستخدم غالباً ما يرمز له بالتيلدا (”~“). من المفيد أن تعلم ذلك لأن مفسرات الأوامر تستبدل التيلدا أوتوماتيكيًا بالمجلد الصحيح (عادة /home/user/).
تقليديًا، تُخزَّن ملفات إعدادات التطبيقات داخل مجلد بيت المستخدم مباشرة، لكن عادة ما تبدأ أسماؤها بنقطة (مثلاً، عميل البريد mutt يخزن إعداداته في ‎~/.muttrc). الملفات التي يبدأ اسمها بنقطة مخفية افتراضيًا؛ ولا يسردها الأمر ls إلا عند استخدام الخيار -a، أما برامج إدارة الملفات الرسومية فيجب أن تطلب منها عرض الملفات المخفية.
Some programs also use multiple configuration files organized in one directory (for instance, ~/.ssh/). Some applications also use their directory to store a cache of downloaded data. This means that those directories can end up using a lot of disk space.
These configuration files stored directly in a user's home directory, often collectively referred to as dotfiles, have long proliferated to the point that these directories can be quite cluttered with them. Fortunately, an effort led collectively under the FreeDesktop.org umbrella has resulted in the “XDG Base Directory Specification”, a convention that aims at cleaning up these files and directories. This specification states that configuration files should be stored under ~/.config/, cache files under ~/.cache/, and application data files under ~/.local/ (or subdirectories thereof). This convention is slowly gaining traction, and several applications (especially graphical ones) have started following it.
Graphical desktops usually display the contents of the ~/Desktop/ directory (or whatever the appropriate translation is for systems not configured in English) on the desktop (i.e. what is visible on screen once all applications are closed or iconized).
أخيرًا، أحيانا يخزن نظام البريد الإلكتروني البريد الوارد في مجلد ‎~/Mail/‎.