SlideShare una empresa de Scribd logo
1 de 30
‫مبادئ ‪UNIX‬‬


    ‫تمت الترجمة بواسطة‬
      ‫معتز عالء عثمان‬


    ‫تمت المراجعة بواسطة‬
         ‫محمد فراج‬




‫1‬
‫الفهرس‬


                    Subject                            Page Number
           1-1 Virtual Consoles and Terminals               5
                                1-1-1 The consoles          5
                       1-1-2 Logging into FreeBSD           6
                            1-1-3 Multiple Consoles         7
                            1-1-4 The /etc/ttys File        7
                   1-1-5 Single User Mode Console           8
               1-1-6 Changing Console Video Mode            8
                                1-2 Permissions             9
                        1-2-2 Symbolic Permissions         10
                           1-2-3 FreeBSD File Flags        11
                        1-3 Directory Structure            12
                          1-4 Disk Organization            14
    1-5 Mounting and Unmounting File Systems               19
                                1-5-1 The fstab File       19
                       1-5-2 The mount Command             20
                     1-5-3 The unmount Command             20
                                   1-6 Processes           21
    1-7 Daemons, Signals, and Killing Processes            24
                                       1-8 Shells          26
                         1-8-2 Changing Your Shell         27
                                  1-9 Text Editor          28
                1-10 Devices and Device Nodes              29
                     1-10-2 Creating Device Nodes          29
             1-10-2-1 DEVFS (DEVice File System)           29
                             1-11 Binary Formats           30




2
‫ِفزبػ اٌّظطٍؾبد‬


    Virtual Consoles and Terminals
                       Permissions
                Directory Structure
                 Disk Organization
     Daemons, Signals, and Killing
                         Processes
                              Shells
                        Text Editor
         Devices and Device Nodes
                    Binary Formats
                        File system
                              Kernel
                           Directory
                                PPP
                                UFS




3
‫موجز عه الموضوع‬

    FreeBSD operating ( ‫٘زا اٌفظً ع١زؾذس ػٓ أُ٘ ا٤ٚاِش ٚاٌٛظبئف اٌزٟ رخض‬
                                                                )system.

    ‫ ٌزا إرا وٕذ عذ٠ذ‬UNIX operating system ٗ‫اٌىض١ش ِٓ ٘زٖ اٌّٛاد راد طٍخ ٚرشج‬
                           .‫ الشأ ٘زا اٌفظً ثؼٕب٠خ‬FreeBSD operating system ٟ‫ف‬

                                                 : ٍُ‫ثؼذ لشاءح ٘زا اٌفظً ,عززؼ‬




                              How to use the “virtual consoles” of FreeBSD.   
      How UNIX file permissions work along with understanding file flags in   
                                                                   FreeBSD.
                                    The default FreeBSD file system layout.   
                                            The FreeBSD disk organization.    
                                  How to mount and unmount file systems.      
                                What processes, daemons, and signals are.     
        What a shell is, and how to change your default login environment.    
                                             How to use basic text editors.   
                                       What devices and device nodes are.     
                                What binary format is used under FreeBSD.     
                           How to read manual pages for more information.     




4
Virtual Consoles and Terminals : 1.1



      Text Terminal ٟ‫ ثبٌؼذ٠ذ ِٓ اٌطشق ِٕٙب وزبثخ ا٤ٚاِش ف‬FreeBSD َ‫٠ّىٓ اعزخذا‬

 .‫ ثٙزٖ اٌطش٠مخ‬FreeBSD َ‫ عزىْٛ ِزبؽخ ٌه ػٕذ اعزخذا‬UNIX ‫وض١ش ِٓ ِشٚٔخ ٚلٛح‬

  . FreeBSDٟ‫ ٚو١ف رغزخذُِٙ ف‬consoles and terminal ٛ٘ ‫ٚ٘زا اٌفظً ٠ششػ ِب‬



                                                             The consoles 1.1.1

  ‫ رٍمبئ١ب ع١ؼشع ٌه‬graphical environment ً‫ ثشى‬FreeBSD ‫إرا ٌُ رىٓ اخزشد اْ ٠جذأ‬
                           :ٟ‫إٌظبَ ثؼذ اْ ٠فزؼ ٔبفزٖ ٌزغغ١ً اٌذخٛي ِشبثٙخ ٌ٣ر‬

Additional ABI support:.
Local package initialization:.
Additional TCP options:.

Fri Sep 20 13:01:06 EEST 2002

FreeBSD/i386 (pc3.example.org) (ttyv0)

login:

                                 :ٓ٠‫عزشٜ ش١ئب ٠شجٗ ٘زا ٌٚىٕٕب عٕٙزُ فمؾ ثأخش عطش‬

FreeBSD/i386 (pc3.example.org) (ttyv0)

                            :ًّ‫ اٌزٞ ثذأ ٠ؼ‬system ٓ‫٘زا اٌغطش ٠ؾزٛٞ ػٍٝ ِؼٍِٛبد ػ‬

           ‫ ٚاعّٙب‬Intel processor X86 architecture ٍٝ‫ رؾزٛٞ ػ‬FreeBSD console ٖ‫٘ز‬
                                                               (pc3.example.org)

                                               .ُ‫ ٌٙب اع‬UNIX machine ً‫ٍِؾٛظخ :و‬

                                                             . terminal ٛ٘ (ttyv0) ٚ

                                                                             : ‫ٚأخ١شا‬
                                                                                ً

login:
  5
‫فٟ ٘زا اٌغضء ٠غت وزبثخ اعُ اٌّغزخذَ ٚع١زُ ششػ ٘زا فٟ اٌفظً ا٨ؽك.‬



                                                   ‫1.1.1 ‪Logging into FreeBSD‬‬


 ‫٠ؼذ ‪ٚ FreeBSD‬اؽذ ِٓ ‪٘ٚ multiuser ,multiprocessing system‬زا اٌٛطف ٠طٍك‬
‫ػٍٝ أٞ ٔظبَ ٠ّىٓ اْ ٠غزخذَ ػٓ ؽش٠ك اٌؼذ٠ذ ِٓ اٌّغزخذِ١ٓ اٌز٠ٓ ٠ؼٍّْٛ‬
                                    ‫ػٍٝ اٌؼذ٠ذ ِٓ اٌجشاِظ فٟ ٔفظ اٌٛلذ.‬

        ‫وً ‪٠ multiuser system‬غت اْ ٠ّ١ض ث١ٓ وً ِغزخذَ ٌٗ, ٚ٘زا ٠ؾذس ثطٍت‬
                           ‫اي ‪ username and password‬وً ِشح ػٕذ ا٦عزخذاَ.‬
      ‫وً ِغزخذَ ٌٗ ‪ّ٠ ٨ username‬ىٓ رىشاسٖ ٚ‪ password‬خبطخ ثٗ ٠غت اْ ٠مَٛ‬
                                           ‫ثئدخبٌٙب لجً اْ ٠غزخذَ أٞ ثشٔبِظ.‬
                        ‫ٌزا ثؼذ اْ ٠مَٛ ‪ FreeBSD boot‬عزظٙش اٌشبشخ اٌزبٌ١خ.‬

‫:‪login‬‬
                                          ‫فٍٕفشع اْ اعُ اٌّغزخذَ :‪Moataz‬‬

‫‪login: Moataz‬‬
‫:‪Password‬‬
 ‫لُ ثئدخبي ‪ password‬اٌخبص ثـ ‪ٌٚ Moataz‬ىٕٗ ٌٓ ٠ظٙش ٌزا ٨ رمٍك ؽ١بي رٌه ا٢ْ‬
                              ‫,ٌٕمٛي اْ ٘زا ٤عجبة إِٔ١ٗ ‪. security reasons‬‬

 ‫إرا لّذ ثئدخبي ‪ password‬طؾ١ؾخ عزشٜ )‪٠ MOTD (message of the day‬زجؼٙب‬
    ‫)‪٘ command prompt (a #, $, or % character‬زا ٠ؼٕٟ أٔه عغٍذ اٌذخٛي‬
                                                       ‫ثطش٠مخ طؾ١ؾخ.‬




  ‫6‬
Multiple Consoles 1.1.1

 ِٓ ‫ ٠ّىٕه اْ رؼًّ ػٍٝ أوضش‬FreeBSD ٟ‫ ع١ذ, ٌٚىٓ ف‬UNIX ٟ‫اعزخذاَ ٔبفزٖ ٚاؽذح ف‬
                                                      .‫ثشٔبِظ فٟ ٔفظ اٌٛلذ‬

      ِٓ ‫ٌزا إرا اعزخذِذ ٔبفزح ٚاؽذٖ ٌٓ رىْٛ ؽش٠مٗ ع١ذح ِغ ٔظبَ ٠ّىٓ اْ ٠ذ٠ش اٌؼذ٠ذ‬
                              . Virtual consoles ‫اٌجشاِظ فٟ ٔفظ اٌٛلذ, ٕٚ٘ب ٠أرٟ دٚس‬

     ُٕٙ١‫ ٚ٠ّىٕه اْ رٕزمً ث‬virtual consoles ِٓ ‫٠ّىٓ اْ ٠ؼًّ ػٍٝ اٌؼذ٠ذ‬FreeBSD
‫ ثزٕمٍه ٚؽفع ٚرؾٛ٠ً ِذخ٩د ٌٛؽخ‬FreeBSD ُ‫ثئعزخذاَ ٌٛؽخ اٌّفبر١ؼ ثغٌٙٛخ ٚع١ٙز‬
                                 . ‫ آخش‬console ٌٝ‫ إ‬console ِٓ ‫اٌّفبر١ؼ ػٕذ أزمبٌه‬

     ٝ‫ ؽز‬Alt-F1, Alt-F2َ‫ ثبعزخذا‬FreeBSD ‫ٚلذ رُ ؽغض ثؼغ اٌّفبر١ؼ ٌٍزؾٛ٠ً ث١ٓ ٔٛافز‬
      .‫ ,ٚػٕذ اٌزؾٛي ِٓ ٔبفزٖ إٌٝ أخشٜ ٨ رزٛلف ػٓ اٌؼًّ ػٕذِب رىْٛ غ١ش ظب٘شح‬Alt-F8



                                                         1.1.4 The /etc/ttys File

     ٞٛ‫ ٚوً عطش ٠جذأ ثـ(#) ٠ؾز‬virtual consoles 8 ٍٝ‫إْ ا٦ػذاداد ا٤عبع١خ رؾزٛٞ ػ‬
.ttyv ‫ٚ ٠ّىٕه ِؼشفزُٙ اْ وً ٚاؽذ ٠جذأ ثـ‬virtual console or a terminal ‫ػٍٝ اػذاداد ي‬

                   # name getty                     type    statuscomments
                                                                           #
                           ttyv0 "/usr/libexec/getty Pc"  cons25 on secure
                                                          # Virtual terminals
                           ttyv1 "/usr/libexec/getty Pc"  cons25 on secure
                           ttyv2 "/usr/libexec/getty Pc"  cons25 on secure
                           ttyv3 "/usr/libexec/getty Pc"  cons25 on secure
                           ttyv4 "/usr/libexec/getty Pc"  cons25 on secure
                           ttyv5 "/usr/libexec/getty Pc"  cons25 on secure
                           ttyv6 "/usr/libexec/getty Pc"  cons25 on secure
                           ttyv7 "/usr/libexec/getty Pc"  cons25 on secure
                      ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure




 7
Single User Mode Console 1.1.1

 ‫ ٚ إػذاداد ٌٙزا‬virtual consoles ٞ‫ ٚاؽذح ٚ٨ ٠ٛعذ أ‬console ‫فٟ ٘زا إٌظبَ عزغذ فمؾ‬
     . console ‫/ اثؾش ػٓ اٌغطش اٌجبدا ثـىٍّخ‬etc/ttys ٟ‫إٌظبَ ٠ّىٓ اْ رغذ٘ب أ٠ؼب ف‬

# name getty                     type status            comments
#
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console none                     unknown off secure

                                                                       : ‫ٍِؾٛظخ‬
 root ‫ ٌٚىٓ ٠غت اْ رىْٛ ػٍٝ ػٍُ ثـ‬secure to insecure ِٓ ‫٠ّىٕه اْ رؼذي ا٨ػذاداد‬
    ‫ ٚإرا ٔغ١زٗ ٌ١ظ ِٓ اٌّغزؾ١ً رشغ١ً إٌظبَ صبٔ١ب ٌٚىٕٗ طؼت إرا‬password
                                           .FreeBSD ًٌ ‫وٕذ ِغزخذَ عذ٠ذ‬


                                         Changing Console Video Mode 1.1.1
 ‫4201 أٚ أٞ ِغبؽخ‬x768 , 1280x1024 ٍٝ‫ إػذادارٙب اٌشئ١غ١خ ػ‬FreeBSD video mode
  recompile the Kernel َٛ‫ِبخٛرح ِٓ وبسد اٌشبشخ ,٠ّىٕه رغ١ش٘ب ٌٚىٓ ٠غت أٚ٨ اْ رم‬
                                                                .ٓ١١‫ثبػذاد٠ٓ اػبف‬
options VESA
options SC_PIXEL_MODE

  hardware ّٗ‫ اٌزٞ ٠ذػ‬video mode ٛ٘‫ ٠ّىٓ اْ رشٜ ِب‬Kernelً٠‫ثّغشد اْ لّذ ثزؼذ‬
                                                    vidcontrol َ‫اٌخبص ثه ثبعزخذا‬
# vidcontrol -i mode
                          َ‫ ثبعزخذا‬root console ٟ‫٠ّىٓ ثؼذ ِؼشفزه ٌٗ اْ رذخٍٗ ف‬
# vidcontrol MODE_279
                     ‫ ػٓ ؽش٠ك‬boot ‫ ِمجٛي ٠ّىٓ اْ ٠ؼذ دائّب ثؼذ‬video mode ْ‫إرا وب‬
allscreens_flags="MODE_279"




  8
Permissions 1.1.1
‫ ؽ١ش ٠ّىٕٗ اْ ٠مَٛ ثبٌؼذ٠ذ ِٓ اٌّٙبَ اٌزٟ ٌ١ظ‬FreeBSD multiuser operating system
hardware devices, ‫ث١ٕٙب طٍخ فٟ ٔفظ اٌٛلذ. ٚ٠ىْٛ إٌظبَ ِغئٛي ػٓ ِشبسوخ ٚإداسح‬
                           .َ‫ ٌىً ِغزخذ‬peripherals, memory and CPU time fairly

 permission ٟ‫ٚثغجت اْ إٌظبَ ٠زؼبًِ ِغ اٌؼذ٠ذ ِٓ اٌّغزخذِ١ٓ, ٠زؾىُ إٌظبَ ٚ٠ؼط‬
3 octets ٟ‫ ف‬permissionsٓ٠‫ ٠زُ رخض‬who can read, write and execute the resources
 one to the owner ,one to the group it belongs to ‫ ٠ٕمغُ إٌٝ ص٩س لطغ‬octet ً‫ٚو‬
                       :‫ ,ٚ٘زا اٌزّض١ً اٌشلّٟ ٠ؼًّ ٘ىزا‬and one for everyone else
  Value                        Permission            Directory
                                                        Listing
      0              No read, no write, no execute           ---
      1                  No read, no write, execute          --x
      2                  No read, write, no execute         -w-
      3                     No read, write, execute        -wx
      4                  Read, no write, no execute          r--
      5                     Read, no write, execute          r-x
      6                     Read, write, no execute         rw-
      7                        Read, write, execute        rwx

                                 ‫ ِضبي‬file permission ‫ ٌزظٙش‬ls –l ‫٠ّىٕه اعزخذاَ أِش‬
% ls –l
total 530
-rw-r--r-- 1 root wheel     512 Sep 5 12:31 myfile
-rw-r--r-- 1 root wheel     512 Sep 5 12:31 otherfile
-rw-r--r-- 1 root wheel    7680 Sep 5 12:31 email.txt
...
                                                                    :‫ٚ٘زا ششػ اٌٍّف‬
-rw-r--r--
     (directory, a ْٛ‫ػ٩ِخ )-( الظٝ اٌشّبي رش١ش إٌٝ أٗ ٍِف ػبدٞ ؽ١ش ٠ّىٓ اْ ٠ى‬
         special character device, a socket, or any other special pseudo-file device)
 group that the file belong ‫ ,ثؼذ٘ب ص٩س ي‬owner of the file ‫اٌض٩س ؽشٚف ثؼذ٘ب ٟ٘ ي‬
                                                 . for everyone else ‫ ,ثؼذ٘ب ص٩س ي‬to
read, write to the owner ,read to the group and read to everyone else ‫ٕٚ٘ب ِٕؼ أِش‬
                                                                                     .
permission ‫ٚ٠ّىٓ رّض١ً ٘زا ؽجمب ٌٍغذٚي أػ٩ٖ 466 .ؽ١ش ٠ّضً اٌشلُ ص٩س اعضاء ِٓ اي‬
                                                                                     .


  9
read , write and ُٙ‫ ؽ١ش ٠ّىٓ اػطبئ‬files ً‫ ِض‬directories ًِ‫٠ّىٕه ا٠ؼب اْ رؼب‬
       ٍٗ‫ رغزط١غ اْ رغؼ‬directory as execute ‫ ٌٚىٓ ػٕذِب رؼذ‬execute permission
                                   . traversed so you can cd (change directory)
 ‫ ٌٚىٟ رغزط١غ اْ رّغؼ‬read permission ‫ ٠غت اػطبء‬directory listing ‫ٌٚىٟ رمَٛ ثـ‬
‫ اٌزٞ ٠ؾزٛٞ ػٍٝ اٌٍّف‬directory ًٌ write and execute permission ‫ٍِف ٠غت اػطبء‬
                                                                               .


                                                Symbolic Permissions 1.1.1
      ٟ٘ٚ symbolic permissions َ‫ ثب٨سلبَ ٠ّىٕه اعزخذا‬permission ‫ثذ٨ ِٓ اػطبء اي‬
                                  : (who) (action) (permissions) ‫رغزخذَ ػ٩لخ‬

                   option                    Letter                   represents
                   (who)                         U                           User
                   (who)                         G                 Group owner
                   (who)                         O                          Other
                   (who)                          A                            All
                 (action)                        +          Adding permissions
                 (action)                         -     Removing permissions
                 (action)                        =    Explicitly set permissions
            (permissions)                         R                         Read
            (permissions)                        W                          Write
            (permissions)                         X                      Execute
            (permissions)                         T                     Sticky bit
            (permissions)                         S              Set UID or GID

                                                : ‫٠ّىٓ اعزخذاَ ا٨ِش وّب فٍغبثك‬
%chmod go=file
 execute permission ‫ ٚ٠ؼطٟ أِش‬group and world write permission ‫٘زا ا٨ِش ٠ّغؼ‬
                                                                     .‫ٌٍغّ١غ‬
% chmod go-w,a+x FILE




 11
FreeBSD File Flags 1.1.1
   ‫ ٚ٘زا ٌٍٍّفبد فمؾ ٌٚ١ظ‬Security and control ِٓ ‫ رغزخذَ ٨ػطبء اٌّض٠ذ‬File flags
                                                                     .directories
. ّٟ‫ػٕذ اعزخذاَ ٘زٖ اٌخبط١خ ٠ّىٕه اٌزأوذ أٗ ٨ اؽذ ٠ّىٕٗ ِغؼ أٚ اعزجذاي ٍِف ِؾ‬
                                            ‫ رغزخذَ أِش‬file1 ٍٝ‫ ػ‬file flag ً‫ٌزفؼ‬
# chflags sunlink file1
                                                               :َ‫ٚ٦ٌغبء٘ب اعزخذ‬
# chflags nosunlink file1
                                                              flags of file1 ‫٨ظٙبس‬
#ls –lo file1

Output will look like :

-rw-r--r-- 1 trhodes trhodes sunlnk 0 Mar 1 05:54 file1




  11
1.3.1 Directory Structure
The FreeBSD directory hierarchy is fundamental to obtaining an overall
understanding of the system.
a brief overview of the most common directories.

              directory                                                    Description
                        /                           Root directory of the file system.
                    /bin/ User utilities fundamental to both single-user and multi-
                                                                   user environments.
                 /boot/ Programs and configuration files used during operating
                                                                    system bootstrap.
       /boot/defaults/                      Default bootstrapping configuration files
                   /dev/                                                 Device nodes
                    /etc/                      System configuration files and scripts.
         /etc/defaults/                            Default system configuration files
             /etc/mail/        Configuration files for mail transport agents such as
                                                                             send mail
        /etc/namedb/                                        named configuration files
         /etc/periodic/              Scripts that are run daily, weekly, and monthly
             /etc/ppp/                                         ppp configuration files
                  /mnt/                  Empty directory commonly used by system
                                        administrators as a temporary mount point.
                  /proc/                                           Process file system
               /rescue/         Statically linked programs for emergency recovery
                  /root/                        Home directory for the root account.
                  /sbin/               System programs and administration utilities
                                    fundamental to both single-user and multi-user
                                                                        environments.
                  /tmp/ Temporary files. The contents of /tmp are usually NOT
                           preserved across a system reboot. A memory-based file
                                      system is often mounted at /tmp. This can be
                          automated using the tmpmfs-related variables of rc.conf
                    /usr/             The majority of user utilities and applications.
              /usr/bin/ Common utilities, programming tools, and applications.
          /usr/include/                                      Standard C include files.
               /usr/lib/                                             Archive libraries.
          /usr/libdata/                                Miscellaneous utility data files.
          /usr/libexec/     System daemons & system utilities (executed by other
 12
programs).
       /usr/local/           Local executables, libraries, etc. Also used as the
                         default destination for the FreeBSD ports framework.
                         Within /usr/local, the general layout sketched out by
                         hier for /usr should be used. Exceptions are the man
                       directory, which is directly under /usr/local rather than
                       under /usr/local/share, and the ports documentation is
                                                              in share/doc/port.
        /usr/obj/       Architecture-specific target tree produced by building
                                                               the /usr/src tree.
      /usr/ports/                      The FreeBSD Ports Collection (optional).
       /usr/sbin/    System daemons & system utilities (executed by users).
      /usr/share/                                Architecture-independent files.
         /usr/src/                                BSD and/or local source files.
     /usr/X11R6/      X11R6 distribution executables, libraries, etc (optional).
             /var/    Multi-purpose log, temporary, transient, and spool files.
                       A memory-based file system is sometimes mounted at
                        /var. This can be automated using the varmfs-related
                        variables of rc.conf(5) (or with an entry in /etc/fstab;
                                                                 see mdmfs(8)).
        /var/log/                                Miscellaneous system log files.
       /var/mail/                                             User mailbox files.
      /var/spool/               Miscellaneous printer and mail system spooling
                                                                     directories.
       /var/tmp/     Temporary files. The files are usually preserved across a
                            system reboot, unless /var is a memory-based file
                                                                         system.
         /var/yp/                                                     NIS maps.




13
Disk Organization 1.1
     case-ٟ٘ٚ. ‫ أْ ٠غزخذَ ٌٍجؾش ػٓ اٌٍّفبد ٘ٛ اعُ اٌٍّف‬FreeBSD ِٓ ‫أطغش ٚؽذح‬
                  .ْ٩‫ ٍِفبْ ِٕفظ‬readme.txt ٚReadme.txt ْ‫ ، ِّب ٠ؼٕٟ أ‬sensitive
ٚ‫ اٌٍّف ٌزؾذ٠ذ ِب إرا وبْ اٌٍّف ٘ٛ ثشٔبِظ، أٚ ِغزٕذ، أ‬extension َ‫ ٨ ٠غزخذ‬FreeBSD
                                                             .‫أٞ شىً آخش ِٓ اٌج١بٔبد‬

‫ لذ ٨ رؾزٛٞ ػٍٝ ٍِفبد ، أٚ أٔٙب لذ رؾزٛٞ ػٍٝ ػذح‬directories ٟ‫٠زُ رخض٠ٓ اٌٍّفبد ف‬
    ‫ أخشٜ، ِّب ٠غّؼ ٌه ٌجٕبء‬directories ٍٝ‫ِئبد ِٓ اٌٍّفبد .٠ّىٓ أْ رؾزٛٞ أ٠ؼب ػ‬
ُ١‫ داخً ثؼؼٙب اٌجؼغ . ٘زا ٠غؼً ِٓ ا٨عًٙ ثىض١ش ٌزٕظ‬directories ًٌ ِٟ‫اٌزغٍغً اٌٙش‬
                                                                .‫اٌج١بٔبد اٌخبطخ ثه‬

  ‫ ثئػطبء اعُ اٌٍّف أٚ اٌذٌ١ً، ، /، رٍ١ٙب أٞ أعّبء‬directories ٚ ‫٠زُ اٌشعٛع إٌٟ اٌٍّفبد‬
    ٍٝ‫ ، اٌزٞ ٠ؾزٛٞ ػ‬directory named Foo ‫ ا٤خشٜ اٌؼشٚس٠خ .إرا وبْ ٌذ٠ه‬directories
  ٌٝ‫ ، صُ ا٨عُ اٌىبًِ، أٚ اٌّغبس إ‬Readme.txt ‫ ، اٌزٞ ٠ؾزٛٞ ػٍٝ ٍِف‬directory bar
                                                      . foo/bar/readme.txt. ٛ٘ ‫اٌٍّف‬

         ٍٝ‫ ٠ؾزٛٞ ػ‬File System ً‫ .و‬File system ٟ‫ ٚاٌٍّفبد ف‬directories ٓ٠‫٠زُ رخض‬
. File System ‫ ٌٙزا‬root directory ٝ‫ ٚاؽذ ثبٌؼجؾ ػٍٝ أػٍٝ ِغزٜٛ ، ٚ ٠ذػ‬directory
                           .ٜ‫ أخش‬directories ٍٝ‫ ٠ّىٓ اْ رؾزٛٞ ػ‬root directory ‫٘زا‬

                   . C:/ foo/bar/readme.txt ً‫ ِض‬path nameٍٝ‫ ٨ ٠ؾزٛٞ ػ‬FreeBSD

 a1,a2 as other directories ٖ‫ 3 ٚوً ُِٕٙ ػٕذ‬file System A,B and C ‫افزشع أٔه ػٕذن‬
                                                                 . B and C ‫ٚوزٌه‬
                                       .ً‫ وّب ثبٌشى‬root file system ٛ٘ A ْٛ‫ع١ى‬




 a1 ‫ ثـ‬B ‫ .ع١غزجذي‬a1 directory ٍٝ‫ ٌٗ ػ‬mount ًّ‫ ٚ ٔمَٛ ثؼ‬B ‫صُ ٔفشع أْ أؽؼشٔب‬
                                                      :ٟ‫ٚع١ظٙش اٌشىً و٥ر‬




 14
‫وً اٌٍّفبد اٌّٛعٛدح فٟ 2‪ّ٠ b1 , b‬ىٓ اٌٛطٛي اٌ١ٗ ػٓ ؽش٠ك 2‪/a1/b1 or /a1/b‬‬
‫ٚوً اٌٍّفبد اٌّٛعٛدح فٟ 1‪ a‬رُ اخفبء٘ب ِؤلذ ,ٚع١زُ اظٙبس٘ب إرا لّٕب ‪unmount for‬‬
                                                                   ‫1‪.B from a‬‬

                         ‫ٚ٠ّىٓ ا٠ؼب اْ ٔمَٛ ثـ ‪ mount for C‬إٌٝ 1‪ b‬ف١ىْٛ و٥رٟ:‬




                                    ‫أٚ ٔمَٛ ثـ ‪ mount for C‬إٌٝ ‪ِ A‬جبششح و٥رٟ:‬




‫51‬
‫إٔه رمَٛ ثئػذاد ‪ File Systems‬ػٕذِب رمَٛ ثـ ‪ ٨ٚ FreeBSD installation‬رمَٛ ثزغ١شُ٘ إٌٝ‬
                                                          ‫إرا لّذ ثبػبفخ ‪. new disk‬‬

                                     ‫ٕٚ٘بن ِضا٠ب ٚػ١ٛة ٨عزؼّبي ‪. one big file system‬‬

                                                   ‫ِضا٠ب اعزخذاَ ‪: multiple file system‬‬
      ‫‪ّ٠ٚ ‬ىٕٗ اػطبئه ِخزٍف اٌخ١بساد ‪ for mounting‬ػٍٝ عج١ً اٌّضبي ، ِغ اٌزخط١ؾ‬
         ‫اٌذل١ك ، ٠ّىٓ رشو١جٗ ػٍٝ ‪ root file system‬وأٔٗ ‪ِّ ، read-only‬ب ٠غؼً ِٓ‬
                    ‫اٌّغزؾ١ً ثبٌٕغجخ ٌه ٌؾزف ػٓ غ١ش لظذ أٚ رؼذ٠ً ٍِف ؽشعخ.‬
      ‫وّب اْ فظً ‪ّٕ٠ writable file systems‬غ ‪ suid and guid bits‬اْ رؾذس رغ١ش ِّب‬
                                                          ‫٠ؼذٞ اٌّض٠ذ ِٓ اٌؾّب٠خ.‬

       ‫‪٠ FreeBSD ‬ؾغٓ رٍمبئ١ب رخط١ؾ اٌٍّفبد ػٍٝ ‪ ،file system‬اػزّبدا ػٍٝ و١ف١خ‬
     ‫اعزخذاَ ‪ٚ File system‬ػٍٝ ٘زا فئْ ٔظبَ اٌٍّفبد اٌزٟ رؾزٛٞ ػٍٝ اٌؼذ٠ذ ِٓ‬
     ‫اٌٍّفبد اٌظغ١شح اٌزٟ رزُ وزبثزٙب ثشىً ِزىشس ع١ىْٛ ٌٙب رخط١ؾ ِخزٍف ٠ؾزٛٞ‬
     ‫ػٍٝ ػذد ألً ِٓ أوجش اٌٍّفبد .ٌٚىٓ ٚعٛد ‪ٚ file system‬اؽذ وج١ش ع١غؼً ٘زا‬
                                                                 ‫اٌزؾغ١ٓ ٠ٕٙبس.‬
  ‫‪ FreeBSD's file systems ‬لٛ٠خ عذا ٚ٠ٕجغٟ أْ رفمذ اٌغٍطخ .ِٚغ رٌه، ٠ّىٓ ٌفمذاْ‬
‫اٌطبلخ فٟ ٌؾظخ ؽشعخ اٌؼشس ثـٙ١ىً ‪file system‬ػٓ ؽش٠ك رمغ١ُ اٌج١بٔبد ػجش ‪file‬‬
         ‫‪ِ systems‬زؼذدح ، ِّب ٠غؼً ِٓ ا٤عًٙ ثبٌٕغجخ ٌه ٨عزؼبدح ِٓ إٌغخخ‬
                                              ‫ا٨ؽز١بؽ١خ ‪ backup‬ؽغت اٌؼشٚسح.‬

                                                   ‫ِضا٠ب اعزخذاَ ‪: single file system‬‬
‫‪ٌٙ File systems ‬ب ؽغُ صبثذ .إرا لّذ ثئٔشبء ‪ file system‬ػٕذ ‪FreeBSD installation‬‬
   ‫ٚاػطبئٙب ؽغُ ِؾذد، لذ رىزشف فٟ ٚلذ ٨ؽك أٔه رؾزبط ٌغؼً ‪ partition‬اوجش .‬
 ‫ٚ٘زا ٨ ٠زؾمك ثغٌٙٛخ دْٚ إٌغخ ا٨ؽز١بؽٟ ‪ٚ ،backup‬إػبدح ثٕبء‪ِ file system‬غ‬
                                             ‫اٌؾغُ اٌغذ٠ذ، صُ اعزؼبدح اٌج١بٔبد‬

 ‫61‬
ِٓ ‫ ِغبؽخ‬FreeBSD َ‫ , ٠مذ‬swap spaceً‫ ٠غزخذَ أ٠ؼب ِغبؽخ ِٓ أع‬FreeBSD
       ‫اٌزاوشح ا٨فزشاػٟ ,٠غّؼ ٘زا اٌىّج١ٛرش اٌزظشف وّب ٌٛ أْ ِغبؽزٗ أوضش ِٓ اٌزاوشح‬
       ‫اٌّٛعٛدح ػٕذِب رٕفذ اٌزاوشح رزؾشن ثؼغ اٌج١بٔبد اٌزٟ ٨ رغزخذَ ؽبٌ١ب إٌٝ اٌزاوشح‬
                                                                           .‫ا٨فزشاػ١خ‬

                                          : ‫ ٚثؼغ ا٨رفبل١بد اٌّشرجطخ ثٙب‬partitions ‫ثؼغ‬

       Partition                                                          Convention
               A                             Normally contains the root file system
               B                                     Normally contains swap space
               C        Normally the same size as the enclosing slice. This allows
                     utilities that need to work on the entire slice (for example, a
                    bad block scanner) to work on the c partition. You would not
                                     normally create a file system on this partition.
              D     Partition d used to have a special meaning associated with it,
                        although that is now gone and d may work as any normal
                                                                            partition.

                          .‫ شش٠ؾخ‬slice ٝ‫ ٠ذػ‬file system ٍٝ‫ ٠ؾزٛٞ ػ‬partition ً‫و‬
      FreeBSD from UNIX ‫، ِٚشح أخشٜ، ٚ٘زا ٘ٛ ثغجت اسرجبؽ‬FreeBSD ‫ ٘ٛ ِظطٍؼ‬Slice
                                 .4 ٌٝ‫ ٠زُ رشل١ُ اٌششائؼ، اثزذاء ِٓ 1 إ‬background

ُ‫ٚأخ١شا، ٠ زُ رؾذ٠ذ وً لشص ػٍٝ إٌظبَ اعُ اٌمشص ٠جذأ ِغ سِض ٠ش١ش إٌٝ ٔٛع اٌمشص، ص‬
ُ‫ ، اٌمشص رشل١ُ ٠جذأ فٟ 0 ٠ز‬slides ‫ػذد، ِش١شا إٌٝ اٌمشص اٌزٞ ٘ٛ ػٍ١ٗ .ٚػٍٝ ػىظ‬
                                      :‫عشد اٌشِٛص اٌّشزشوخ اٌزٟ عٛف رشا٘ب فٍغذٚي‬
                                   Code                                Meaning
                                     Ad                       ATAPI (IDE) disk
                                     Da                 SCSI direct access disk
                                    Acd                   ATAPI (IDE) CDROM
                                     Cd                           SCSI CDROM
                                     Fd                             Floppy disk

                                                                                   : ‫ِضبي‬
            Name                                                              Meaning
           Ad0s1a     The first partition (a) on the first slice (s1) on the first IDE
                                                                           disk (ad0).
           Da1s2e   The fifth partition (e) on the second slice (s2) on the second
                                                                     SCSI disk (da1).

 17
ٍٝ‫ ٌج١ئخ رطٛ٠ش ِزىبٍِخ اٌمشص ا٤ٚي رؼٍك ػ‬FreeBSD ‫٠ظٙش ٘زا اٌشعُ اٌج١بٟٔ ػشع‬
 2 ‫إٌظبَ. ٔفزشع أْ اٌمشص ٘ٛ 4 غ١غب ثب٠ذ فٟ اٌؾغُ ، ٚ٠ؾزٛٞ ػٍٝ اصٕ١ٓ ِٓ ششائؼ‬
ٞٛ‫ ٚ٠ؾز‬c:،MS-DOS disk ٍٝ‫). اٌشش٠ؾخ ا٤ٌٚٝ رؾزٛٞ ػ‬MS-DOS partitions( ‫غ١غبثب٠ذ‬
   .swap partition ٚ ،‫. ٌٗ ص٩صخ ألغبَ اٌج١بٔبد‬FreeBSD instllation ‫ػٍٝ شش٠ؾخ اٌضبٔ١خ‬

     e for /var directory ، A for root file system , file system َ‫ٚع١ىْٛ ثبٌض٩صخ ألغب‬
                                             . f for /usr directory hierarchy ٚ hierarchy




18
Mounting and Unmounting File Systems 1.1

‫ وفشٚع اٌزٟ ٠ّىٓ اْ ٠ىْٛ ٌٙب‬directories ٟ‫ ٘ٛ وٍشغشح ٚثبل‬file system ًٌ ‫أفؼً ٚطف‬
                                                           .‫ٟ٘ ا٠ؼب فشٚع خبطخ ثٙب‬

                            . file systems ٟ‫ ف‬directories ً‫ٕٚ٘بن أعجبة ػذ٠ذح ٌفظ‬
       ‫/ ٘ٛ شٟء‬var form / ً‫ ٌ١ظ فىشٖ ع١ذٖ ٌزٌه فئْ فظ‬root file system ٥ِ ْ٤ ٨ٚ‫أ‬
                                                                          .ً‫ِفؼ‬

                                                                The fstab File 1.1.1
       .‫ رٍمبئ١ب‬mounting ‫/ ٚ٠ؾذس‬etc/fstab ٟ‫ رىْٛ ف‬file systems , booting ‫خ٩ي ػٍّ١خ‬
                            :ٗ١ٌ‫/ ٠ؾزٛٞ ػٍٝ لبئّٗ ِٓ اٌغطٛس ٌٙب اٌظ١غخ اٌزب‬etc/fstab

                 device      /mount-point fstype       options     dumpfreq      passno

          device                                A device name (which should exist)
      Mount-point      A directory (which should exist), on which to mount the file
                                                                               system.
           Fstype      The file system type to pass to mount. The default FreeBSD
                                                                    file system is ufs.
          Options      Either rw for read-write file systems, or ro for read-only file
                      systems, followed by any other options that may be needed.
                           A common option is noauto for file systems not normally
                       mounted during the boot sequence. Other options are listed
                                                      in the mount(8) manual page.
       Dumpfreq            This is used by dump(8) to determine which file systems
                          require dumping. If the field is missing, a value of zero is
                                                                             assumed.
          passno         This determines the order in which file systems should be
                         checked. File systems that should be skipped should have
                     their passno set to zero. The root file system (which needs to
                    be checked before everything else) should have its passno set
                    to one, and other file systems' passno should be set to values
                          greater than one. If more than one file systems have the
                    same passno then fsck(8) will attempt to check file systems in
                                                                  parallel if possible.




 19
The mount Command 1.1.1
                                                                  ٗ‫أوضش ؽش٠مٗ ِؼشٚف‬
                                                         # mount device mountpoint

                                                : ‫ٕ٘بن اٌؼذ٠ذ ِٓ ا٦خز١بساد ٌٚىٓ أشٙش٘ب‬
           -a           Mount all the file systems listed in /etc/fstab. Except those
                    marked as “noauto”, excluded by the -t flag, or those that are
                                                                    already mounted.
           -d          Do everything except for the actual mount system call. This
                 option is useful in conjunction with the -v flag to determine what
                                                    mount(8) is actually trying to do.
            -f   Force the mount of an unclean file system (dangerous), or forces
                  the revocation of write access when downgrading a file system's
                                         mount status from read-write to read-only.
            -r     Mount the file system read-only. This is identical to using the ro
                                                          argument to the -o option.
     -t fstype        Mount the given file system as the given file system type, or
                  mount only file systems of the given type, if given the -a option.

                                               “ufs” is the default file system type.
           -u                            Update mount options on the file system.
            -v                                                            Be verbose.
           -w                                     Mount the file system read-write.
            -o   option takes a comma-separated list of the options, including the
                                                                            following:
      Noexec     Do not allow execution of binaries on this file system. This is also
                                                            a useful security option.
      Nosuid      Do not interpret setuid or setgid flags on the file system. This is
                                                       also a useful security option.

                                                   The unmount Command 1.1.1
 . file system ‫ ٠ّىٕٗ رذِ١ش اٌىّج١ٛرش أٚ اٌج١بٔبد ػٍٝ اي‬unmounting file systems ‫وش٘ب‬

                                .unmount all mounted file systems ‫- رغزخذَ ي‬A ٚ-a
                                                                         : ‫ٍِؾٛظخ‬
                                                 . file systemًٌ unmount ‫٨ رمَٛ ثـ‬




21
‫1.1 ‪Processes‬‬

 ‫‪ٔ ٛ٘ FreeBSD‬ظبَ رشغ١ً ِزؼذد اٌّٙبَ .ٚ٘زا ٠ؼٕٟ أٔٗ ٠جذٚ وّب ٌٛ أْ أوضش ِٓ ثشٔبِظ‬
   ‫ٚاؽذ ٘ٛ اٌزٞ ٠شزغً فٟ آْ ٚاؽذ .ٚ٠غّٝ وً ثشٔبِظ ٠ؼًّ فٟ ٔفظ اٌٛلذ ػٍّ١خ‬
‫‪, process‬فئْ وً أِش ٠جذء ٠شغ ً ػٍٝ ا٤لً ػٍّ١خ عذ٠ذح، ٕٚ٘بن ػذد ِٓ اٌؼٍّ١بد اٌزٟ‬
               ‫رمَٛ ثزشغ١ً إٌظبَ فٟ وً ٚلذ ٚ٨ رزٛلف ، ٚاٌؾفبظ ػٍٝ إٌظبَ ٠ؼًّ.‬

      ‫٠زُ اٌزؼشف ثشىً فش٠ذ وً ػٍّ١خ ثٛاعطخ ػذد ٠غّٝ ِؼشف اٌؼٍّ١خ، أٚ ‪ِٚ ،PID‬ضً‬
  ‫اٌٍّفبد، وً ػٍّ١خ ٌٙب ِبٌه ٚاؽذ ِٚغّٛػخ .٠زُ اعزخذاَ اٌّؼٍِٛبد اٌّبٌه ٚاٌّغّٛػخ‬
    ‫ٌزؾذ٠ذ ِب ٟ٘ اٌٍّفبد ٚا٤عٙضح اٌزٟ ٠ّىٓ أْ رفزؼ ، ٚرٌه ثبعزخذاَ ‪. permissions‬‬
     ‫ِؼظُ اٌؼٍّ١بد ٌٙب ػٍّ١خ اطٍ١ٗ . ٚػٍّ١خ ا٤طٍ١خ ٟ٘ اٌؼٍّ١خ اٌزٟ ثذأد ِٕٙب .ػٍٝ‬
‫عج١ً اٌّضبي، إرا وٕذ رىزت ا٤ٚاِش إٌٝ ‪ shell‬فٟٙ ػٍّ١خ ، ٚأ٠خ أٚاِش رشغ١ً اخشٜ رىزجٙب‬
 ‫ٟ٘ ػٍّ١بد ٟ٘ أ٠ؼب .ٚ وً ػٍّ١خ ف١ غ١ىْٛ ‪ ٟ٘ shell‬اطٍٙب . اعزضٕبء ‪process called‬‬
      ‫)‪ ٛ٘ (init‬دائّب أٚي ػٍّ١خ، ٌزٌه ‪ٌٙ PID‬ب ٟ٘ دائّب 1 .ثذء ‪INIT‬رٍمبئ١ب ثٛاعطخ ٔٛاح‬
                                                   ‫‪ FreeBSD Kernel‬ػٕذِب ٠جذأ إٌظبَ.‬

      ‫ٕ٘بن اِشاْ ِّٙبْ ٌّؼشفخ اٌؼٍّ١بد ػٍٝ اٌغٙبص ‪ , PS and top‬أِش ‪٠ ps‬غزخذَ ٌؼشع‬
                                                           ‫لبئّخ صبثزٗ ثبٌؼٍّ١بد اٌغبس٠خ.‬
      ‫أِش ‪ top‬وً اٌؼٍّ١بد اٌغبس٠خ ٚرؼذ٠ٍٙب وً ثؼغ صٛأٟ ٌزٌه ٠ّىٕه ِزبثؼخ اخش اٌزؼذ٠٩د.‬

                                                                               ‫:‪Example‬‬
                                                                                  ‫‪% ps‬‬

            ‫‪PID‬‬           ‫‪STAT‬‬              ‫‪TT‬‬          ‫‪TIME‬‬                ‫‪COMMAND‬‬
            ‫892‬             ‫0‪P‬‬              ‫‪Ss‬‬        ‫01.10:0‬                     ‫‪Tcsh‬‬
           ‫8707‬             ‫0‪P‬‬               ‫‪S‬‬        ‫88.04:2‬          ‫‪xemacs mdoc.xsl‬‬
                                                                      ‫)41.1.12-‪(xemacs‬‬

         ‫39373‬               ‫0‪P‬‬               ‫‪I‬‬       ‫11.30:0‬        ‫‪xemacs freebsd.dsl‬‬
                                                                      ‫)41.1.12-‪(xemacs‬‬

         ‫03684‬               ‫0‪P‬‬              ‫‪S‬‬        ‫-‪2:50.89 /usr/local/lib/netscape‬‬
                                                                ‫-‪linux/navigator-linux‬‬
                                                                                ‫‪4.77.bi‬‬

         ‫03784‬               ‫0‪P‬‬             ‫‪Iw‬‬          ‫0.00:0‬             ‫)‪(dns helper‬‬
                                                                      ‫)-‪(navigator-linux‬‬

         ‫01227‬               ‫0‪P‬‬            ‫+‪R‬‬         ‫00.00:0‬                         ‫‪Ps‬‬
 ‫12‬
390             P1             Is        0:01.14                     Tcsh

        7059             P2           Is+         1:36.18    /usr/local/bin/mutt -y

        6688             P3           Iws         1:36.18                     Tcsh

       10735             P4           Iws         0:00.00                     Tcsh

       20256             P5           Iws         0:00.00                     Tcsh

         262             V0           Iws         0:00.00              -tcsh (tcsh)

         270             V0           Iws         0:00.00                   /bin/sh
                                                            /usr/X11R6/bin/startx -
                                                                         - -bpp 16

         280             V0           Iw+         0:00.00 xinit /home/nik/.xinitrc
                                                                      -- -bpp 16

         284             V0           Iw+         0:00.00                  /bin/sh
                                                                 /home/nik/.xinitrc

         285             V0              s        0:38.45 /usr/X11R6/bin/sawfish


 ٛ٘ . PID ‫ إٌٝ ػذد ِٓ ا٤ػّذح‬PS (1) ِٓ ‫وّب رشْٚ فٟ ٘زا اٌّضبي ، ٠زُ رٕظ١ُ ا٦خشاط‬
      ،99999 ٌٝ‫ ثذءا ِٓ 1 ، رشرفغ إ‬PIDS ٓ١١‫ِ ؼشف ػٍّ١خ ثؾش فٟ ٚلذ عبثك . ٠زُ رؼ‬
   TT ‫ إرا وبْ ثبٌفؼً ل١ذ ا٨عزخذاَ . اٌؼّٛد‬PIDS ‫ٚ٠ٍزف ؽٛي اٌؼٛدح إٌٝ ثذا٠خ ػٕذ ٔفبد‬
       ‫ ٠ج١ٓ ؽبٌخ‬STAT . ٓ٘‫ اٌجشٔبِظ ٠ؼًّ ٚ ثأِبْ ٠ّىٓ رغبٍ٘ٙب فٟ اٌٛلذ اٌشا‬TTY ٓ١‫٠ج‬
‫ ٘ٛ ِمذاس اٌٛلذ اٌزٞ رُ رشغ١ً اٌجشٔبِظ‬TIME ْ‫اٌجشٔبِظ، ِٚشح أخشٜ ،٠ّىٓ رغبٍ٘ٙب ثأِب‬
                                                                          CPU --.ٟ‫ف‬




 22
: top ‫ِضً آخش ػٍٝ أِش‬
% top
last pid: 72257; load averages: 0.13, 0.09, 0.03   up 0+13:38:33 22:39:10
47 processes: 1 running, 46 sleeping
CPU states: 12.6% user, 0.0% nice, 7.8% system, 0.0% interrupt, 79.7% idle
Mem: 36M Active, 5256K Inact, 13M Wired, 6312K Cache, 15M Buf, 408K Free
Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
USERNAME PRI NICE SIZE       RES STATE    TIME WCPU      CPU COMMAND PID
top      nik   28 0 1960K 1044K RUN        0:00 14.86% 1.42%       72257
xemacs-21.1.14    nik    2 0 15280K 10960K select 2:54 0.88% 0.88%             7078
XF86_SVGA        nik    2 0 18636K 7112K select 5:36 0.73% 0.73%             281



ً١‫ ِٓ ػٍّ١خ ِشبسوخ ٌزشغ‬PID ٓ١‫٠زُ رمغ١ُ ا٦ٔزبط إٌٝ لغّ١ٓ .أٚي خّغخ أعطش ٠ج‬
                                                          . َ‫ٚرؾّ١ً إٌظب‬

       ‫اٌغضء اٌزٞ ٠ٍ١ٗ ٟ٘ عٍغٍخ ِٓ ا٤ػّذح اٌزٟ رؾزٛٞ ػٍٝ ِؼٍِٛبد ِشبثٙخ ٌّب خشط‬
         PID, the username, the amount of CPU time ً‫ وّب وبْ ِٓ لجً ِض‬PS (1). ِٓ
                                            taken, and the command that was run




  23
‫‪1.7 Daemons, Signals, and Killing Processes‬‬

   ‫ػٕذ رشغ١ً ِؾشسا ِٓ اٌغًٙ اٌغ١طشح ػٍٝ اٌّؾشس ، ٚ رغؼٍٗ رٌه ٌزؾّ١ً اٌٍّفبد ،‬
 ‫ٍُٚ٘ عشا . ٠ّىٕه اٌم١بَ ثزٌه ٤ْ اٌّؾشس ٠مذَ رغٙ١٩د ٌٍم١بَ ثزٌه ، ٚ٤ْ اٌّؾشس ِشفك‬
         ‫ػٍٝ ‪٠ ٌُ .terminal‬زُ رظّ١ُ ثؼغ اٌجشاِظ ٌ١زُ رشغ١ٍٙب ِغزّشح ِغ ِذخ٩د‬
   ‫اٌّغزخذَ ، ٚؽزٝ أٔٙب رمطغ ا٦رظبي فٟ أٚي فشطخ .ػٍٝ عج١ً اٌّضبي ، خبدَ اٌٛ٠ت‬
  ‫٠مؼٟ ؽٛي اٌ١َٛ ٌ ٩عزغبثخ ٌٍطٍجبد ػٍٝ شجىخ ا٦ٔزشٔذ ، فئٔٗ ػبدح ٨ ٠ؾزبط اٌٝ أٞ‬
     ‫ِغبّ٘خ ِٕه . ثشاِظ اٌجش٠ذ ا٦ٌىزشٟٚٔ ٟ٘ ِضبي ػٍٝ ٘زا إٌٛع ِٓ اٌزطج١ك ا٠ؼب.‬



 ‫ٔؾٓ ٔطٍك ػٍٝ ٘زٖ اٌجشاِظ ‪ٚ. daemons‬وبٔذ ‪ daemons‬ؽشفب فٟ ا٤عبؽ١ش اٌ١ٛٔبٔ١خ :‬
 ‫رؼٕٟ ٨ خ١ش أٚ شش، ، إٌٝ ؽذ وج١ش ، ٚفؼٍذ اش١بء ِف١ذح ٌٍجشش٠خ ، ِضً اٌىض١ش ِٓ خٛادَ‬
                                      ‫اٌٛ٠ت ٚخٛادَ اٌجش٠ذ ِٓ اٌ١َٛ رفؼً أش١بء ِف١ذح.‬



   ‫فٟ ثؼغ ا٤ؽ١بْ عزؾزبط ٌ٧رظبي ثبي ‪ّ٠, daemon process‬ىٓ رٌه ػجش اْ رجؼش ٌٙب‬
 ‫‪ٕ٘, signal‬بن اٌؼذ٠ذ ِٓ أٔٛاع اي ‪ّ٠ ٨ٚ, signals‬ىٕه اْ رجؼش ‪ signal‬إ٨ ًٌ ‪process‬اٌزٟ‬
                                                                             ‫رٍّىٙب.‬



‫ع١مَٛ ‪ FreeBSD‬ثجؼذ .‪ signals to apps‬فٟ ثؼغ اٌؾب٨د ,إرا وزت ثشٔبِظ ثطش٠مخ ع١ئخ‬
                 ‫, ٠مَٛ ‪ FreeBSD‬ثبسعبي )‪. segmentation violation signal (sigsegv‬‬



      ‫ٕ٘بن ‪ two signals‬رغزخذَ ٦٠مبف اٌؼٍّ١ٗ, ‪ ٛ٘ SIGKILL. SIGTERM‬اوضش ؽش٠مخ إِٔٗ‬

      ‫ٌٛلف اٌؼٍّ١ٗ ‪. Killing process‬ؽ١ش ٠ّىٓ ٌٍؼٍّ١ٗ اْ رٍزمؾ اي ‪ٚsignal‬رفُٙ أٔه رشد اْ‬
                                                                            ‫رغٍك اٌؼًّ.‬

      ‫‪ّ٠ ٨ SIGKILL‬ىٓ رغبٍ٘ٗ ثٛاعطخ اٌؼٍّ١ٗ ‪ , process‬إرا اسعٍذ ٘زٖ )‪signal (SIGKILL‬‬
                                                    ‫ع١مَٛ ‪ FreeBSD‬ثغٍك اٌؼٍّ١ٗ فٛسا.‬



       ‫ثؼغ اي ‪ signals‬اٌزٟ ٠ّىٓ اْ رؾزبعٙب ا٠ؼب ٟ٘ 2‪SIGHUP ,SIGUSR1 and SIGUSR‬‬
        ‫ؽ١ش ٠ّىٕه اعزخذاَ ‪ٌ SIGHUP‬غؼً اي ‪ process‬رؼ١ذ لشاءح ٍِف اٌزؼذ٠٩د ثذ٨ ِٓ‬
                                                     ‫ا٠مبف اٌخذِٗ ٚرشغ١ٍٙب ِٓ عذ٠ذ.‬
 ‫42‬
:ً‫ وّب ثبٌّض‬signal to kill a process ‫٠ّىٕه اسعبي‬

‫ ,ٚٔغؼً ٘زا اٌٍّف ٠مشا‬signal to (inetd configuration file) ً‫٘زا اٌّضبي ٠ظٙش و١ف رشع‬
                                                        . SIGHUP َ‫اٌزؼذ٠٩د ثبعزخذا‬

  ‫ اٌزٞ ٠مَٛ ثبٌجؾش‬grep command ‫ ٚا٠ؼب‬PS command َ‫ ثبعزخذا‬PID ‫1-٠غت ِؼشفخ‬
                                                .ٓ١‫ ِؼ‬string ٓ‫فٟ ِخشعبد ػ‬

                                                                 % ps –ax | grep inetd

                                                   198 ?? IWs       0:00.00 inetd –Ww
                                                                        198 ٛ٘ PID ْ‫إر‬

 su َ‫ ٠غت اعزخذا‬root ‫ ٠غزخذَ ثٛاعطخ‬inetd ْ‫ ,ٚثغجت ا‬signal ‫ ٨سعبي‬kill َ‫2-اعزخذ‬
                                                                        .٨ٚ‫ أ‬root ‫ٌ١ظجؼ‬
                                                                                    % su
                                                                              Password:
                                                                 # /bin/kill -s HUP 198
 ‫ ٌؼٍّ١ٗ أذ‬KILL ‫ ٔبعؼ ٌٚىٓ إرا لّذ ثـ‬KILL ْ‫فٟ ِؼظُ ا٤ٔظّخ ٨ رظٙش ٌه أٞ سعبٌٗ ثب‬
                                                                      :‫٨ رٍّىٙب ع١ؼشع‬
                                                  “kill: PID: Operation not permitted”
                                                                                 :‫ٍِؾٛظخ‬
: init ,process ID 1 ٟ‫ ثؼشٛائ١خ ٠ّىٓ اْ رىْٛ فىشٖ ع١ئخ خبطخ ف‬KILL signal َ‫اعزخذا‬
                                                                      /bin/kill -s KILL 1
          .ٖ‫٘زٖ ؽش٠مٗ عش٠ؼٗ ٌزغٍك ثٙب إٌظبَ وٍٗ ,ٌزٌه رأوذ ع١ذا ِٓ ِبرىزجٗ لجً رٕف١ز‬




 25
Shells 1.8.1
ّٝ‫ ا٤ٚاِش ٠غ‬cmd ‫ ٠زُ اٌىض١ش ِٓ اٌؼًّ اٌ١ِٟٛ ثئعزخذاَ ٚاعٙخ عطٛس‬FreeBSD ٟ‫ف‬
‫ اٌشئ١غ١خ رزّضً فٟ ارخبر ا٤ٚاِش ِٓ لٕبح اٌّذخ٩د ٚرٕف١ز٘ب .ٕٚ٘بن‬Shell ‫ ,ٚظ١فخ‬Shell
     ‫ لذ ثٕ١ذ أ٠ؼب فٟ ٚظبئف ٌٍّغبػذح فٟ اٌّٙبَ اٌ١ِٛ١خ ِضً إداسح‬Shells ِٓ ‫اٌىض١ش‬
                                                                         .‫اٌٍّفبد‬

 C-‫ ٠ّىٓ اعزخذاِٙب أفؼً فٕٙبن اٌىض١ش ِٓ ا٨ٔٛاع, ِض٩ إرا وٕذ‬Shell ٞ‫إرا وٕذ ِزؾ١ش أ‬
     ‫ ٠ّىٕه‬Linix ِٟ‫ ,ٚارا وٕذ ِٓ ِغزخذ‬tcsh shell َ‫ ٠ّىٓ اعزخذا‬programmer
                                                            . bash shell َ‫اعزخذا‬

         tab ‫ ٟٚ٘ وزبثخ ِمذِخ اٌىٍّخ صُ ػغؾ‬intelligence sense ‫٠ّىٕه اعزخذاَ خذِخ‬
                           . rem [tab] ‫ رىزت‬remove ‫٨عزىّبي اٌىٍّٗ. ِض٩ ٌىزبثخ أِش‬

                                              :ُ٘‫ٚ٘بٟ٘ لبئّٗ ثأُ٘ اٌّزغ١شاد ِٚؼٕب‬
     variables                            Description
         USER                                      Current logged in user's name.
         PATH           Colon-separated list of directories to search for binaries.
     DISPLAY        Network name of the X11 display to connect to, if available.
       SHELL                                                      The current shell.
        TERM     The name of the user's type of terminal. Used to determine the
                                                       capabilities of the terminal.
 TERMCAP         Database entry of the terminal escape codes to perform various
                                                                 terminal functions.
  OSTYPE                               Type of operating system. e.g., FreeBSD.
MACHTYPE                    The CPU architecture that the system is running on.
  EDITOR                                         The user's preferred text editor.
   PAGER                                          The user's preferred text pager.
 MANPATH          Colon-separated list of directories to search for manual pages.




26
Changing Your Shell 1.8.1
                         . chsh ‫ اٌّغزخذِخ ثبعزخذاَ أِش‬Shell ‫أعًٙ ؽش٠مٗ ٌزغ١ش‬
ٟ‫ ثذْٚ اعجبسن ػٍٝ دخٛي ف‬Shell ‫– ,ٚ٘زا ع١مَٛ ثزغ١١ش‬s in the chsh ‫٠ّىٕه ا٠ؼب اػطبء‬
                                                                          .‫اٌّؾشس‬
                                      :ٟ‫ عزىزت ا٢ر‬bash ٌٝ‫ِض٩ إرا اسدد اٌزغ١١ش إ‬
                                                  % chsh -s /usr/local/bin/bash
                                                                        :‫ٍِؾٛظخ‬
                                 :ٟ‫ ٠ذٚ٠ب عزؾزبط إٌٝ ػًّ ا٨ر‬Shell ً٠‫إرا لّذ ثزٕض‬
                   :ٟ‫/ عزؾزبط إٌٝ ا٨ر‬usr/local/bin ٟ‫ ٠ذٚ٠ب ف‬bash ‫ِض٩ إرا ٚػؼذ‬

                                     # echo "/usr/local/bin/bash" >> /etc/shells

                                                               Then return chsh




 27
‫‪1.9 Text Editor‬‬

   ‫ٚ٠ؾذس اٌىض١ش ِٓ اٌزؼذ٠٩د فٟ ‪ FreeBSD‬ػٓ ؽش٠ك اٌزؼذ٠ً فٟ ٍِفبد ٔظ١خ .ٚثغجت‬
                  ‫٘زا، فئٔٗ ع١ىْٛ فىشح ع١ذح ٌزظجؼ ِأٌٛفب ِغ ِؾشس إٌض ‪.text editor‬‬

   ‫ٚأثغؾ ِؾشس ٌٍزؼٍُ ٘ٛ ِؾشس ٠ذػٝ ‪ ،ee‬اٌزٟ ٟ٘ اخزظبس ‪ِ easy editor‬ؾشس‬         ‫أعًٙ‬
   ‫عًٙ .ٌجذء ‪ّ٠ ،ee‬ىٓ ٤ؽذ أ ْ ٠ىزت أِش ‪ ee filename‬ؽ١ش ‪ ٛ٘ filename‬اعُ اٌٍّف‬
‫اٌّشاد رؾش٠شٖ .ػٍٝ عج١ً اٌّضبي ، ٌزؾش٠ش ‪ ، /etc/rc.conf‬اوزت فٟ ‪ِ /etc/conf ee‬شح ٚاؽذح‬
   ‫ِٓ داخً ‪٠ ، ee‬زُ عشد وبفخ ا٤ٚاِش ٌّؼبٌغخ ِٙبَ اٌزؾش٠ش فٟ أػٍٝ اٌشبشخ .اٌؾشف ^‬
     ‫٠ّضً ِفزبػ ‪ ctrl‬ػٍٝ ٌٛؽخ اٌّفبر١ؼ، ثؾ١ش ‪ٛ٠ ^e‬عغ اٌغ١طشح ػٍٝ رشو١جخ اٌّفبر١ؼ.‬

       ‫ٌّغبدسح ‪ ،ee‬اػغؾ ِفزبػ ‪ ،esc‬صُ اخز١بس ‪ٚ leave editor‬عٛف ٠طبٌجه اٌ ّؾشس ثـؾفع أ٠خ‬
                                                              ‫رغ١١شاد إرا رُ رؼذ٠ً اٌٍّف.‬

       ‫وّب ٠ٛعذ ثبي ‪ِ FreeBSD‬ؾشساد ألٜٛ ِضً ‪ vi‬وغضء ِٓ إٌظبَ ا٤عبعٟ, فٟ ؽ١ٓ اْ‬
                    ‫ِؾشسح اخشٜ ِضً ‪ ُ٘ Emacs and vim‬عضء ِٓ اي ‪.Ports collection‬‬

   ‫٘زٖ اٌّؾشساد رٛفش ٚظبئف أوضش ِٓ رٌه ثىض١ش، ٚاٌمٖٛ رغؼٍٙب أوضش رؼم١ذا ٌٍزؼٍُ .ٌٚىٓ إرا‬
   ‫وٕذ رخطؾ ٌزفؼً اٌىض١ش ِٓ رؾش٠ش إٌض، ٚاٌزؼٍُ ِؾشس ألٜٛ ِضً ‪Emacs or vim‬ع١ٛفش‬
                                                     ‫ٌه ٚلزب أؽٛي ثىض١ش فٟ اٌّذٜ اٌطٛ٠ً.‬




  ‫82‬
‫‪1.10.1 Devices and Device Nodes‬‬
‫رؼش٠ف ‪ّ٠ Device‬ىٓ اْ ٠ىْٛ ِظطٍؼ ٠غزخذَ فٟ اٌغبٌت ٤ٔشطخ راد اٌظٍخ ثـ ‪hardware‬‬
‫فٟ ٘زا إٌظبَ ، ثّب فٟ رٌه ا٤لشاص، ٚاٌطبثؼبد، ٚثطبلبد اٌشعِٛبد ، ٌٚٛؽبد اٌّفبر١ؼ .‬
   ‫ػٕذِب ٠ذخً ‪ FreeBSD‬فٟ ِشؽٍخ ‪ِ ،booting‬ؼظُ ِب ٠مَٛ ثٗ ‪ ٛ٘ FreeBSD‬اٌىشف ػٓ‬
  ‫ا٤عٙضح اٌّٛطٌٛخ . ٠ّىٕه أْ رجؾش ِٓ خ٩ي سعبئً ‪ِ booting‬شح أخشٜ ػٓ ؽش٠ك وزبثخ‬
                                                             ‫‪/var/run/dmesg.boot‬‬

                                                 ‫‪1.10.2 Creating Device Nodes‬‬
      ‫ػٕذ إػبفخ عٙبص عذ٠ذ إٌٝ إٌظبَ اٌخبص ثه، أٚ عّغ ٌ ذػُ أعٙضح إػبف١خ، ٠غت إٔشبء‬
                                                                 ‫‪ Device Node‬عذ٠ذ.‬


                                        ‫)‪1.10.2.1 DEVFS (DEVice File System‬‬
 ‫رّذن ‪ DEVFS‬ثئِىبٔ١خ اٌذخٛي إٌٝ ‪ Kernel's device namespace‬فٟ ‪global file system‬‬
                                                                    ‫‪. namespace‬‬

                  ‫ثذ٨ ِٓ رىٛ٠ٓ أٚ رؼذ٠ً ‪٠, device node‬مَٛ ‪ DEVFS‬ثزؼذ٠ٍٙب خبطخ ٌه.‬




 ‫92‬
‫11.1 ‪Binary Formats‬‬

      ‫٠غزخذَ ‪ FreeBSD‬اي ‪ٌٚ elf format‬ىٓ أٚ٨ ٠غت ِؼشفخ ص٩س ‪ formats‬اعبع١١ٓ فٟ‬
                                                                        ‫‪UNIX‬‬

                                                                          ‫1- ‪a.out‬‬

         ‫ألذَ ‪٠ format‬غزخذِٗ ‪٠ . UNIX‬غزخذَ ‪ header‬لظ١ش ِٚؼغٛؽ ٚسلُ ِّ١ض ٌ١ّ١ض‬
                                       ‫اي ‪٠ٚ, format‬غزخذَ ص٩س ‪ِ segment‬ؾٍّخ :‬

                         ‫‪Text ,data and .bss‬ثب٦ػبفخ إٌٝ عذٚي اٌشِض ٚ ‪.string table‬‬

                                                                         ‫2- ‪coff‬‬
‫‪٠ , SVR3 object format‬ؾزٛٞ اي ‪ header‬ػٍٝ ‪ section table‬ؽ١ش ٠ّىٕه ا٢ْ اْ رؾظً‬
                                    ‫ػٍٝ اوضش ِٓ ‪. .text ,.data and .bss sections‬‬

                                                                             ‫3- ‪elf‬‬
   ‫‪ ٛ٘ ELF‬أوضش رؼج١شا ِٓ ‪٠ ٚ a.out‬غّؼ ٌّض٠ذ ِٓ اٌزّذد فٟ إٌظبَ ا٤عبعٟ .وّب اْ‬
‫أدٚاد ‪ ELF‬أفؼً فٟ اٌظ١بٔخ ، ٚرمذ٠ُ اٌذػُ ، ٚ٘ٛ أِش ُِٙ ٌىض١ش ِٓ إٌبط. ‪ ELF‬لذ ٠ىْٛ‬
‫أثطأ لٍ١٩ ِٓ ‪ٌٚ ،a.out‬ىٓ اٌّؾبٌٚخ ٌم١بط ٘زا ٠ّىٓ أْ رىْٛ طؼجخ .ٕ٘بن أ٠ؼب اٌؼذ٠ذ ِٓ‬
      ‫اٌزفبط١ً اٌزٟ رخزٍف ث١ٓ اٌزٕغ١م١ٓ)‪ (two formats‬فٟ و١ف١خ رخط١ؾ اٌظفؾبد ،‬
                                                       ‫ٚاٌزؼبًِ ِغ ‪ ، INIT code‬اٌخ.‬
                                           ‫٨ شٟء ِٓ ٘زا ُِٙ عذا، ٌىٕٙب أخز٩فبد.‬




 ‫13‬

Más contenido relacionado

La actualidad más candente

Kernel init
Kernel initKernel init
Kernel initgowell
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linuxLiran Ben Haim
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copyShay Cohen
 
Linux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSLinux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSjoshuasoundcloud
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelOpenVZ
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot managerAcácio Oliveira
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Neeraj Shrimali
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespacesLocaweb
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux Kuldeep Tiwari
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System AdministrationSreenatha Reddy K R
 

La actualidad más candente (20)

Kernel init
Kernel initKernel init
Kernel init
 
Linux IO
Linux IOLinux IO
Linux IO
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linux
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
unixtoolbox
unixtoolboxunixtoolbox
unixtoolbox
 
Linux basics
Linux basics Linux basics
Linux basics
 
KCC_Final.pdf
KCC_Final.pdfKCC_Final.pdf
KCC_Final.pdf
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Linux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSLinux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPS
 
Linux basics
Linux basics Linux basics
Linux basics
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot manager
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup.
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespaces
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 

Destacado

精益创业讨论
精益创业讨论精益创业讨论
精益创业讨论Robbin Fan
 
Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.Mike Willbanks
 
Humour Sports
Humour SportsHumour Sports
Humour Sports7X3or10nR
 
Marriott Miami Airport Campus Updated
Marriott Miami Airport Campus UpdatedMarriott Miami Airport Campus Updated
Marriott Miami Airport Campus Updateddlopez9
 
Dg Analysis Haiti Earthquake 14 Jan2010
Dg Analysis Haiti Earthquake 14 Jan2010Dg Analysis Haiti Earthquake 14 Jan2010
Dg Analysis Haiti Earthquake 14 Jan2010Geo Acts
 
Disability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step GuideDisability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step GuideDougIngram
 
How Flipping your Classroom Can Improve Instruction
How Flipping your Classroom Can Improve InstructionHow Flipping your Classroom Can Improve Instruction
How Flipping your Classroom Can Improve InstructionElizabeth Nesius
 
How to start? The Product
How to start? The Product How to start? The Product
How to start? The Product Ido Green
 
Georgia Corporate Governance Diversity Report 2015
Georgia Corporate Governance Diversity Report 2015Georgia Corporate Governance Diversity Report 2015
Georgia Corporate Governance Diversity Report 2015Tom Furlong, CPC
 
Estandares aprendizaje mcs
Estandares aprendizaje mcsEstandares aprendizaje mcs
Estandares aprendizaje mcsGeovanny Armijos
 
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body LanguageIRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body Languagesarahnovotny
 
第12週-2
第12週-2第12週-2
第12週-2fudy9015
 
Social Media Platforms for Small Companies
Social Media Platforms for Small CompaniesSocial Media Platforms for Small Companies
Social Media Platforms for Small CompaniesInboundMarketingPR.com
 
Catalogo di Innova Day Motor Sport Technologies 2013
Catalogo di Innova Day Motor Sport Technologies 2013Catalogo di Innova Day Motor Sport Technologies 2013
Catalogo di Innova Day Motor Sport Technologies 2013Francesco Baruffi
 

Destacado (20)

Estndares
EstndaresEstndares
Estndares
 
精益创业讨论
精益创业讨论精益创业讨论
精益创业讨论
 
Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.
 
What Can You See
What Can You SeeWhat Can You See
What Can You See
 
Humour Sports
Humour SportsHumour Sports
Humour Sports
 
About me
About meAbout me
About me
 
Marriott Miami Airport Campus Updated
Marriott Miami Airport Campus UpdatedMarriott Miami Airport Campus Updated
Marriott Miami Airport Campus Updated
 
Dg Analysis Haiti Earthquake 14 Jan2010
Dg Analysis Haiti Earthquake 14 Jan2010Dg Analysis Haiti Earthquake 14 Jan2010
Dg Analysis Haiti Earthquake 14 Jan2010
 
Disability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step GuideDisability Income Protection: A Step-by-Step Guide
Disability Income Protection: A Step-by-Step Guide
 
How Flipping your Classroom Can Improve Instruction
How Flipping your Classroom Can Improve InstructionHow Flipping your Classroom Can Improve Instruction
How Flipping your Classroom Can Improve Instruction
 
How to start? The Product
How to start? The Product How to start? The Product
How to start? The Product
 
Collaborative Assessment
Collaborative AssessmentCollaborative Assessment
Collaborative Assessment
 
Georgia Corporate Governance Diversity Report 2015
Georgia Corporate Governance Diversity Report 2015Georgia Corporate Governance Diversity Report 2015
Georgia Corporate Governance Diversity Report 2015
 
Estandares aprendizaje mcs
Estandares aprendizaje mcsEstandares aprendizaje mcs
Estandares aprendizaje mcs
 
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body LanguageIRL: How Geeks Undermine Their Presentations & Conversations With Body Language
IRL: How Geeks Undermine Their Presentations & Conversations With Body Language
 
Uni5
Uni5Uni5
Uni5
 
Èdip per a 4rt de la ESO
Èdip per a 4rt de la ESOÈdip per a 4rt de la ESO
Èdip per a 4rt de la ESO
 
第12週-2
第12週-2第12週-2
第12週-2
 
Social Media Platforms for Small Companies
Social Media Platforms for Small CompaniesSocial Media Platforms for Small Companies
Social Media Platforms for Small Companies
 
Catalogo di Innova Day Motor Sport Technologies 2013
Catalogo di Innova Day Motor Sport Technologies 2013Catalogo di Innova Day Motor Sport Technologies 2013
Catalogo di Innova Day Motor Sport Technologies 2013
 

Similar a Understanding UNIX Principles

Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsBimal Jain
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2Acácio Oliveira
 
WinFE: The (Almost) Perfect Triage Tool
WinFE: The (Almost) Perfect Triage ToolWinFE: The (Almost) Perfect Triage Tool
WinFE: The (Almost) Perfect Triage ToolBrent Muir
 
2.1 design hard disk layout v2
2.1 design hard disk layout v22.1 design hard disk layout v2
2.1 design hard disk layout v2Acácio Oliveira
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyNugroho Gito
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboardsDenis Ristic
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsIgor Beliaiev
 

Similar a Understanding UNIX Principles (20)

Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
WinFE: The (Almost) Perfect Triage Tool
WinFE: The (Almost) Perfect Triage ToolWinFE: The (Almost) Perfect Triage Tool
WinFE: The (Almost) Perfect Triage Tool
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
 
2.1 design hard disk layout v2
2.1 design hard disk layout v22.1 design hard disk layout v2
2.1 design hard disk layout v2
 
Sweden11
Sweden11Sweden11
Sweden11
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Genode Compositions
Genode CompositionsGenode Compositions
Genode Compositions
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 
Deft v7
Deft v7Deft v7
Deft v7
 
Batel f re v66
Batel f re v66Batel f re v66
Batel f re v66
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 
windows.pptx
windows.pptxwindows.pptx
windows.pptx
 
Rhce ppt
Rhce pptRhce ppt
Rhce ppt
 
.ppt
.ppt.ppt
.ppt
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Fusioninventory rmll-2011
Fusioninventory rmll-2011Fusioninventory rmll-2011
Fusioninventory rmll-2011
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and Results
 

Más de Mohammed Farrag

Resume for Mohamed Farag
Resume for Mohamed FaragResume for Mohamed Farag
Resume for Mohamed FaragMohammed Farrag
 
Mum Article Recognition for Mohamed Farag
Mum Article Recognition for Mohamed FaragMum Article Recognition for Mohamed Farag
Mum Article Recognition for Mohamed FaragMohammed Farrag
 
Artificial Intelligence Programming in Art by Mohamed Farag
Artificial Intelligence Programming in Art by Mohamed FaragArtificial Intelligence Programming in Art by Mohamed Farag
Artificial Intelligence Programming in Art by Mohamed FaragMohammed Farrag
 
The practices, challenges and opportunities of board composition and leadersh...
The practices, challenges and opportunities of board composition and leadersh...The practices, challenges and opportunities of board composition and leadersh...
The practices, challenges and opportunities of board composition and leadersh...Mohammed Farrag
 
Confirmation letter info tech 2013(1)
Confirmation letter info tech 2013(1)Confirmation letter info tech 2013(1)
Confirmation letter info tech 2013(1)Mohammed Farrag
 

Más de Mohammed Farrag (10)

Resume for Mohamed Farag
Resume for Mohamed FaragResume for Mohamed Farag
Resume for Mohamed Farag
 
Mum Article Recognition for Mohamed Farag
Mum Article Recognition for Mohamed FaragMum Article Recognition for Mohamed Farag
Mum Article Recognition for Mohamed Farag
 
Create 2015 Event
Create 2015 EventCreate 2015 Event
Create 2015 Event
 
Artificial Intelligence Programming in Art by Mohamed Farag
Artificial Intelligence Programming in Art by Mohamed FaragArtificial Intelligence Programming in Art by Mohamed Farag
Artificial Intelligence Programming in Art by Mohamed Farag
 
The practices, challenges and opportunities of board composition and leadersh...
The practices, challenges and opportunities of board composition and leadersh...The practices, challenges and opportunities of board composition and leadersh...
The practices, challenges and opportunities of board composition and leadersh...
 
Confirmation letter info tech 2013(1)
Confirmation letter info tech 2013(1)Confirmation letter info tech 2013(1)
Confirmation letter info tech 2013(1)
 
Google APPs and APIs
Google APPs and APIsGoogle APPs and APIs
Google APPs and APIs
 
FreeBSD Handbook
FreeBSD HandbookFreeBSD Handbook
FreeBSD Handbook
 
Master resume
Master resumeMaster resume
Master resume
 
Mohammed Farrag Resume
Mohammed Farrag ResumeMohammed Farrag Resume
Mohammed Farrag Resume
 

Último

Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 

Último (20)

Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 

Understanding UNIX Principles

  • 1. ‫مبادئ ‪UNIX‬‬ ‫تمت الترجمة بواسطة‬ ‫معتز عالء عثمان‬ ‫تمت المراجعة بواسطة‬ ‫محمد فراج‬ ‫1‬
  • 2. ‫الفهرس‬ Subject Page Number 1-1 Virtual Consoles and Terminals 5 1-1-1 The consoles 5 1-1-2 Logging into FreeBSD 6 1-1-3 Multiple Consoles 7 1-1-4 The /etc/ttys File 7 1-1-5 Single User Mode Console 8 1-1-6 Changing Console Video Mode 8 1-2 Permissions 9 1-2-2 Symbolic Permissions 10 1-2-3 FreeBSD File Flags 11 1-3 Directory Structure 12 1-4 Disk Organization 14 1-5 Mounting and Unmounting File Systems 19 1-5-1 The fstab File 19 1-5-2 The mount Command 20 1-5-3 The unmount Command 20 1-6 Processes 21 1-7 Daemons, Signals, and Killing Processes 24 1-8 Shells 26 1-8-2 Changing Your Shell 27 1-9 Text Editor 28 1-10 Devices and Device Nodes 29 1-10-2 Creating Device Nodes 29 1-10-2-1 DEVFS (DEVice File System) 29 1-11 Binary Formats 30 2
  • 3. ‫ِفزبػ اٌّظطٍؾبد‬ Virtual Consoles and Terminals Permissions Directory Structure Disk Organization Daemons, Signals, and Killing Processes Shells Text Editor Devices and Device Nodes Binary Formats File system Kernel Directory PPP UFS 3
  • 4. ‫موجز عه الموضوع‬ FreeBSD operating ( ‫٘زا اٌفظً ع١زؾذس ػٓ أُ٘ ا٤ٚاِش ٚاٌٛظبئف اٌزٟ رخض‬ )system. ‫ ٌزا إرا وٕذ عذ٠ذ‬UNIX operating system ٗ‫اٌىض١ش ِٓ ٘زٖ اٌّٛاد راد طٍخ ٚرشج‬ .‫ الشأ ٘زا اٌفظً ثؼٕب٠خ‬FreeBSD operating system ٟ‫ف‬ : ٍُ‫ثؼذ لشاءح ٘زا اٌفظً ,عززؼ‬ How to use the “virtual consoles” of FreeBSD.  How UNIX file permissions work along with understanding file flags in  FreeBSD. The default FreeBSD file system layout.  The FreeBSD disk organization.  How to mount and unmount file systems.  What processes, daemons, and signals are.  What a shell is, and how to change your default login environment.  How to use basic text editors.  What devices and device nodes are.  What binary format is used under FreeBSD.  How to read manual pages for more information.  4
  • 5. Virtual Consoles and Terminals : 1.1 Text Terminal ٟ‫ ثبٌؼذ٠ذ ِٓ اٌطشق ِٕٙب وزبثخ ا٤ٚاِش ف‬FreeBSD َ‫٠ّىٓ اعزخذا‬ .‫ ثٙزٖ اٌطش٠مخ‬FreeBSD َ‫ عزىْٛ ِزبؽخ ٌه ػٕذ اعزخذا‬UNIX ‫وض١ش ِٓ ِشٚٔخ ٚلٛح‬ . FreeBSDٟ‫ ٚو١ف رغزخذُِٙ ف‬consoles and terminal ٛ٘ ‫ٚ٘زا اٌفظً ٠ششػ ِب‬ The consoles 1.1.1 ‫ رٍمبئ١ب ع١ؼشع ٌه‬graphical environment ً‫ ثشى‬FreeBSD ‫إرا ٌُ رىٓ اخزشد اْ ٠جذأ‬ :ٟ‫إٌظبَ ثؼذ اْ ٠فزؼ ٔبفزٖ ٌزغغ١ً اٌذخٛي ِشبثٙخ ٌ٣ر‬ Additional ABI support:. Local package initialization:. Additional TCP options:. Fri Sep 20 13:01:06 EEST 2002 FreeBSD/i386 (pc3.example.org) (ttyv0) login: :ٓ٠‫عزشٜ ش١ئب ٠شجٗ ٘زا ٌٚىٕٕب عٕٙزُ فمؾ ثأخش عطش‬ FreeBSD/i386 (pc3.example.org) (ttyv0) :ًّ‫ اٌزٞ ثذأ ٠ؼ‬system ٓ‫٘زا اٌغطش ٠ؾزٛٞ ػٍٝ ِؼٍِٛبد ػ‬ ‫ ٚاعّٙب‬Intel processor X86 architecture ٍٝ‫ رؾزٛٞ ػ‬FreeBSD console ٖ‫٘ز‬ (pc3.example.org) .ُ‫ ٌٙب اع‬UNIX machine ً‫ٍِؾٛظخ :و‬ . terminal ٛ٘ (ttyv0) ٚ : ‫ٚأخ١شا‬ ً login: 5
  • 6. ‫فٟ ٘زا اٌغضء ٠غت وزبثخ اعُ اٌّغزخذَ ٚع١زُ ششػ ٘زا فٟ اٌفظً ا٨ؽك.‬ ‫1.1.1 ‪Logging into FreeBSD‬‬ ‫٠ؼذ ‪ٚ FreeBSD‬اؽذ ِٓ ‪٘ٚ multiuser ,multiprocessing system‬زا اٌٛطف ٠طٍك‬ ‫ػٍٝ أٞ ٔظبَ ٠ّىٓ اْ ٠غزخذَ ػٓ ؽش٠ك اٌؼذ٠ذ ِٓ اٌّغزخذِ١ٓ اٌز٠ٓ ٠ؼٍّْٛ‬ ‫ػٍٝ اٌؼذ٠ذ ِٓ اٌجشاِظ فٟ ٔفظ اٌٛلذ.‬ ‫وً ‪٠ multiuser system‬غت اْ ٠ّ١ض ث١ٓ وً ِغزخذَ ٌٗ, ٚ٘زا ٠ؾذس ثطٍت‬ ‫اي ‪ username and password‬وً ِشح ػٕذ ا٦عزخذاَ.‬ ‫وً ِغزخذَ ٌٗ ‪ّ٠ ٨ username‬ىٓ رىشاسٖ ٚ‪ password‬خبطخ ثٗ ٠غت اْ ٠مَٛ‬ ‫ثئدخبٌٙب لجً اْ ٠غزخذَ أٞ ثشٔبِظ.‬ ‫ٌزا ثؼذ اْ ٠مَٛ ‪ FreeBSD boot‬عزظٙش اٌشبشخ اٌزبٌ١خ.‬ ‫:‪login‬‬ ‫فٍٕفشع اْ اعُ اٌّغزخذَ :‪Moataz‬‬ ‫‪login: Moataz‬‬ ‫:‪Password‬‬ ‫لُ ثئدخبي ‪ password‬اٌخبص ثـ ‪ٌٚ Moataz‬ىٕٗ ٌٓ ٠ظٙش ٌزا ٨ رمٍك ؽ١بي رٌه ا٢ْ‬ ‫,ٌٕمٛي اْ ٘زا ٤عجبة إِٔ١ٗ ‪. security reasons‬‬ ‫إرا لّذ ثئدخبي ‪ password‬طؾ١ؾخ عزشٜ )‪٠ MOTD (message of the day‬زجؼٙب‬ ‫)‪٘ command prompt (a #, $, or % character‬زا ٠ؼٕٟ أٔه عغٍذ اٌذخٛي‬ ‫ثطش٠مخ طؾ١ؾخ.‬ ‫6‬
  • 7. Multiple Consoles 1.1.1 ِٓ ‫ ٠ّىٕه اْ رؼًّ ػٍٝ أوضش‬FreeBSD ٟ‫ ع١ذ, ٌٚىٓ ف‬UNIX ٟ‫اعزخذاَ ٔبفزٖ ٚاؽذح ف‬ .‫ثشٔبِظ فٟ ٔفظ اٌٛلذ‬ ِٓ ‫ٌزا إرا اعزخذِذ ٔبفزح ٚاؽذٖ ٌٓ رىْٛ ؽش٠مٗ ع١ذح ِغ ٔظبَ ٠ّىٓ اْ ٠ذ٠ش اٌؼذ٠ذ‬ . Virtual consoles ‫اٌجشاِظ فٟ ٔفظ اٌٛلذ, ٕٚ٘ب ٠أرٟ دٚس‬ ُٕٙ١‫ ٚ٠ّىٕه اْ رٕزمً ث‬virtual consoles ِٓ ‫٠ّىٓ اْ ٠ؼًّ ػٍٝ اٌؼذ٠ذ‬FreeBSD ‫ ثزٕمٍه ٚؽفع ٚرؾٛ٠ً ِذخ٩د ٌٛؽخ‬FreeBSD ُ‫ثئعزخذاَ ٌٛؽخ اٌّفبر١ؼ ثغٌٙٛخ ٚع١ٙز‬ . ‫ آخش‬console ٌٝ‫ إ‬console ِٓ ‫اٌّفبر١ؼ ػٕذ أزمبٌه‬ ٝ‫ ؽز‬Alt-F1, Alt-F2َ‫ ثبعزخذا‬FreeBSD ‫ٚلذ رُ ؽغض ثؼغ اٌّفبر١ؼ ٌٍزؾٛ٠ً ث١ٓ ٔٛافز‬ .‫ ,ٚػٕذ اٌزؾٛي ِٓ ٔبفزٖ إٌٝ أخشٜ ٨ رزٛلف ػٓ اٌؼًّ ػٕذِب رىْٛ غ١ش ظب٘شح‬Alt-F8 1.1.4 The /etc/ttys File ٞٛ‫ ٚوً عطش ٠جذأ ثـ(#) ٠ؾز‬virtual consoles 8 ٍٝ‫إْ ا٦ػذاداد ا٤عبع١خ رؾزٛٞ ػ‬ .ttyv ‫ٚ ٠ّىٕه ِؼشفزُٙ اْ وً ٚاؽذ ٠جذأ ثـ‬virtual console or a terminal ‫ػٍٝ اػذاداد ي‬ # name getty type statuscomments # ttyv0 "/usr/libexec/getty Pc" cons25 on secure # Virtual terminals ttyv1 "/usr/libexec/getty Pc" cons25 on secure ttyv2 "/usr/libexec/getty Pc" cons25 on secure ttyv3 "/usr/libexec/getty Pc" cons25 on secure ttyv4 "/usr/libexec/getty Pc" cons25 on secure ttyv5 "/usr/libexec/getty Pc" cons25 on secure ttyv6 "/usr/libexec/getty Pc" cons25 on secure ttyv7 "/usr/libexec/getty Pc" cons25 on secure ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure 7
  • 8. Single User Mode Console 1.1.1 ‫ ٚ إػذاداد ٌٙزا‬virtual consoles ٞ‫ ٚاؽذح ٚ٨ ٠ٛعذ أ‬console ‫فٟ ٘زا إٌظبَ عزغذ فمؾ‬ . console ‫/ اثؾش ػٓ اٌغطش اٌجبدا ثـىٍّخ‬etc/ttys ٟ‫إٌظبَ ٠ّىٓ اْ رغذ٘ب أ٠ؼب ف‬ # name getty type status comments # # If console is marked "insecure", then init will ask for the root password # when going to single-user mode. console none unknown off secure : ‫ٍِؾٛظخ‬ root ‫ ٌٚىٓ ٠غت اْ رىْٛ ػٍٝ ػٍُ ثـ‬secure to insecure ِٓ ‫٠ّىٕه اْ رؼذي ا٨ػذاداد‬ ‫ ٚإرا ٔغ١زٗ ٌ١ظ ِٓ اٌّغزؾ١ً رشغ١ً إٌظبَ صبٔ١ب ٌٚىٕٗ طؼت إرا‬password .FreeBSD ًٌ ‫وٕذ ِغزخذَ عذ٠ذ‬ Changing Console Video Mode 1.1.1 ‫4201 أٚ أٞ ِغبؽخ‬x768 , 1280x1024 ٍٝ‫ إػذادارٙب اٌشئ١غ١خ ػ‬FreeBSD video mode recompile the Kernel َٛ‫ِبخٛرح ِٓ وبسد اٌشبشخ ,٠ّىٕه رغ١ش٘ب ٌٚىٓ ٠غت أٚ٨ اْ رم‬ .ٓ١١‫ثبػذاد٠ٓ اػبف‬ options VESA options SC_PIXEL_MODE hardware ّٗ‫ اٌزٞ ٠ذػ‬video mode ٛ٘‫ ٠ّىٓ اْ رشٜ ِب‬Kernelً٠‫ثّغشد اْ لّذ ثزؼذ‬ vidcontrol َ‫اٌخبص ثه ثبعزخذا‬ # vidcontrol -i mode َ‫ ثبعزخذا‬root console ٟ‫٠ّىٓ ثؼذ ِؼشفزه ٌٗ اْ رذخٍٗ ف‬ # vidcontrol MODE_279 ‫ ػٓ ؽش٠ك‬boot ‫ ِمجٛي ٠ّىٓ اْ ٠ؼذ دائّب ثؼذ‬video mode ْ‫إرا وب‬ allscreens_flags="MODE_279" 8
  • 9. Permissions 1.1.1 ‫ ؽ١ش ٠ّىٕٗ اْ ٠مَٛ ثبٌؼذ٠ذ ِٓ اٌّٙبَ اٌزٟ ٌ١ظ‬FreeBSD multiuser operating system hardware devices, ‫ث١ٕٙب طٍخ فٟ ٔفظ اٌٛلذ. ٚ٠ىْٛ إٌظبَ ِغئٛي ػٓ ِشبسوخ ٚإداسح‬ .َ‫ ٌىً ِغزخذ‬peripherals, memory and CPU time fairly permission ٟ‫ٚثغجت اْ إٌظبَ ٠زؼبًِ ِغ اٌؼذ٠ذ ِٓ اٌّغزخذِ١ٓ, ٠زؾىُ إٌظبَ ٚ٠ؼط‬ 3 octets ٟ‫ ف‬permissionsٓ٠‫ ٠زُ رخض‬who can read, write and execute the resources one to the owner ,one to the group it belongs to ‫ ٠ٕمغُ إٌٝ ص٩س لطغ‬octet ً‫ٚو‬ :‫ ,ٚ٘زا اٌزّض١ً اٌشلّٟ ٠ؼًّ ٘ىزا‬and one for everyone else Value Permission Directory Listing 0 No read, no write, no execute --- 1 No read, no write, execute --x 2 No read, write, no execute -w- 3 No read, write, execute -wx 4 Read, no write, no execute r-- 5 Read, no write, execute r-x 6 Read, write, no execute rw- 7 Read, write, execute rwx ‫ ِضبي‬file permission ‫ ٌزظٙش‬ls –l ‫٠ّىٕه اعزخذاَ أِش‬ % ls –l total 530 -rw-r--r-- 1 root wheel 512 Sep 5 12:31 myfile -rw-r--r-- 1 root wheel 512 Sep 5 12:31 otherfile -rw-r--r-- 1 root wheel 7680 Sep 5 12:31 email.txt ... :‫ٚ٘زا ششػ اٌٍّف‬ -rw-r--r-- (directory, a ْٛ‫ػ٩ِخ )-( الظٝ اٌشّبي رش١ش إٌٝ أٗ ٍِف ػبدٞ ؽ١ش ٠ّىٓ اْ ٠ى‬ special character device, a socket, or any other special pseudo-file device) group that the file belong ‫ ,ثؼذ٘ب ص٩س ي‬owner of the file ‫اٌض٩س ؽشٚف ثؼذ٘ب ٟ٘ ي‬ . for everyone else ‫ ,ثؼذ٘ب ص٩س ي‬to read, write to the owner ,read to the group and read to everyone else ‫ٕٚ٘ب ِٕؼ أِش‬ . permission ‫ٚ٠ّىٓ رّض١ً ٘زا ؽجمب ٌٍغذٚي أػ٩ٖ 466 .ؽ١ش ٠ّضً اٌشلُ ص٩س اعضاء ِٓ اي‬ . 9
  • 10. read , write and ُٙ‫ ؽ١ش ٠ّىٓ اػطبئ‬files ً‫ ِض‬directories ًِ‫٠ّىٕه ا٠ؼب اْ رؼب‬ ٍٗ‫ رغزط١غ اْ رغؼ‬directory as execute ‫ ٌٚىٓ ػٕذِب رؼذ‬execute permission . traversed so you can cd (change directory) ‫ ٌٚىٟ رغزط١غ اْ رّغؼ‬read permission ‫ ٠غت اػطبء‬directory listing ‫ٌٚىٟ رمَٛ ثـ‬ ‫ اٌزٞ ٠ؾزٛٞ ػٍٝ اٌٍّف‬directory ًٌ write and execute permission ‫ٍِف ٠غت اػطبء‬ . Symbolic Permissions 1.1.1 ٟ٘ٚ symbolic permissions َ‫ ثب٨سلبَ ٠ّىٕه اعزخذا‬permission ‫ثذ٨ ِٓ اػطبء اي‬ : (who) (action) (permissions) ‫رغزخذَ ػ٩لخ‬ option Letter represents (who) U User (who) G Group owner (who) O Other (who) A All (action) + Adding permissions (action) - Removing permissions (action) = Explicitly set permissions (permissions) R Read (permissions) W Write (permissions) X Execute (permissions) T Sticky bit (permissions) S Set UID or GID : ‫٠ّىٓ اعزخذاَ ا٨ِش وّب فٍغبثك‬ %chmod go=file execute permission ‫ ٚ٠ؼطٟ أِش‬group and world write permission ‫٘زا ا٨ِش ٠ّغؼ‬ .‫ٌٍغّ١غ‬ % chmod go-w,a+x FILE 11
  • 11. FreeBSD File Flags 1.1.1 ‫ ٚ٘زا ٌٍٍّفبد فمؾ ٌٚ١ظ‬Security and control ِٓ ‫ رغزخذَ ٨ػطبء اٌّض٠ذ‬File flags .directories . ّٟ‫ػٕذ اعزخذاَ ٘زٖ اٌخبط١خ ٠ّىٕه اٌزأوذ أٗ ٨ اؽذ ٠ّىٕٗ ِغؼ أٚ اعزجذاي ٍِف ِؾ‬ ‫ رغزخذَ أِش‬file1 ٍٝ‫ ػ‬file flag ً‫ٌزفؼ‬ # chflags sunlink file1 :َ‫ٚ٦ٌغبء٘ب اعزخذ‬ # chflags nosunlink file1 flags of file1 ‫٨ظٙبس‬ #ls –lo file1 Output will look like : -rw-r--r-- 1 trhodes trhodes sunlnk 0 Mar 1 05:54 file1 11
  • 12. 1.3.1 Directory Structure The FreeBSD directory hierarchy is fundamental to obtaining an overall understanding of the system. a brief overview of the most common directories. directory Description / Root directory of the file system. /bin/ User utilities fundamental to both single-user and multi- user environments. /boot/ Programs and configuration files used during operating system bootstrap. /boot/defaults/ Default bootstrapping configuration files /dev/ Device nodes /etc/ System configuration files and scripts. /etc/defaults/ Default system configuration files /etc/mail/ Configuration files for mail transport agents such as send mail /etc/namedb/ named configuration files /etc/periodic/ Scripts that are run daily, weekly, and monthly /etc/ppp/ ppp configuration files /mnt/ Empty directory commonly used by system administrators as a temporary mount point. /proc/ Process file system /rescue/ Statically linked programs for emergency recovery /root/ Home directory for the root account. /sbin/ System programs and administration utilities fundamental to both single-user and multi-user environments. /tmp/ Temporary files. The contents of /tmp are usually NOT preserved across a system reboot. A memory-based file system is often mounted at /tmp. This can be automated using the tmpmfs-related variables of rc.conf /usr/ The majority of user utilities and applications. /usr/bin/ Common utilities, programming tools, and applications. /usr/include/ Standard C include files. /usr/lib/ Archive libraries. /usr/libdata/ Miscellaneous utility data files. /usr/libexec/ System daemons & system utilities (executed by other 12
  • 13. programs). /usr/local/ Local executables, libraries, etc. Also used as the default destination for the FreeBSD ports framework. Within /usr/local, the general layout sketched out by hier for /usr should be used. Exceptions are the man directory, which is directly under /usr/local rather than under /usr/local/share, and the ports documentation is in share/doc/port. /usr/obj/ Architecture-specific target tree produced by building the /usr/src tree. /usr/ports/ The FreeBSD Ports Collection (optional). /usr/sbin/ System daemons & system utilities (executed by users). /usr/share/ Architecture-independent files. /usr/src/ BSD and/or local source files. /usr/X11R6/ X11R6 distribution executables, libraries, etc (optional). /var/ Multi-purpose log, temporary, transient, and spool files. A memory-based file system is sometimes mounted at /var. This can be automated using the varmfs-related variables of rc.conf(5) (or with an entry in /etc/fstab; see mdmfs(8)). /var/log/ Miscellaneous system log files. /var/mail/ User mailbox files. /var/spool/ Miscellaneous printer and mail system spooling directories. /var/tmp/ Temporary files. The files are usually preserved across a system reboot, unless /var is a memory-based file system. /var/yp/ NIS maps. 13
  • 14. Disk Organization 1.1 case-ٟ٘ٚ. ‫ أْ ٠غزخذَ ٌٍجؾش ػٓ اٌٍّفبد ٘ٛ اعُ اٌٍّف‬FreeBSD ِٓ ‫أطغش ٚؽذح‬ .ْ٩‫ ٍِفبْ ِٕفظ‬readme.txt ٚReadme.txt ْ‫ ، ِّب ٠ؼٕٟ أ‬sensitive ٚ‫ اٌٍّف ٌزؾذ٠ذ ِب إرا وبْ اٌٍّف ٘ٛ ثشٔبِظ، أٚ ِغزٕذ، أ‬extension َ‫ ٨ ٠غزخذ‬FreeBSD .‫أٞ شىً آخش ِٓ اٌج١بٔبد‬ ‫ لذ ٨ رؾزٛٞ ػٍٝ ٍِفبد ، أٚ أٔٙب لذ رؾزٛٞ ػٍٝ ػذح‬directories ٟ‫٠زُ رخض٠ٓ اٌٍّفبد ف‬ ‫ أخشٜ، ِّب ٠غّؼ ٌه ٌجٕبء‬directories ٍٝ‫ِئبد ِٓ اٌٍّفبد .٠ّىٓ أْ رؾزٛٞ أ٠ؼب ػ‬ ُ١‫ داخً ثؼؼٙب اٌجؼغ . ٘زا ٠غؼً ِٓ ا٨عًٙ ثىض١ش ٌزٕظ‬directories ًٌ ِٟ‫اٌزغٍغً اٌٙش‬ .‫اٌج١بٔبد اٌخبطخ ثه‬ ‫ ثئػطبء اعُ اٌٍّف أٚ اٌذٌ١ً، ، /، رٍ١ٙب أٞ أعّبء‬directories ٚ ‫٠زُ اٌشعٛع إٌٟ اٌٍّفبد‬ ٍٝ‫ ، اٌزٞ ٠ؾزٛٞ ػ‬directory named Foo ‫ ا٤خشٜ اٌؼشٚس٠خ .إرا وبْ ٌذ٠ه‬directories ٌٝ‫ ، صُ ا٨عُ اٌىبًِ، أٚ اٌّغبس إ‬Readme.txt ‫ ، اٌزٞ ٠ؾزٛٞ ػٍٝ ٍِف‬directory bar . foo/bar/readme.txt. ٛ٘ ‫اٌٍّف‬ ٍٝ‫ ٠ؾزٛٞ ػ‬File System ً‫ .و‬File system ٟ‫ ٚاٌٍّفبد ف‬directories ٓ٠‫٠زُ رخض‬ . File System ‫ ٌٙزا‬root directory ٝ‫ ٚاؽذ ثبٌؼجؾ ػٍٝ أػٍٝ ِغزٜٛ ، ٚ ٠ذػ‬directory .ٜ‫ أخش‬directories ٍٝ‫ ٠ّىٓ اْ رؾزٛٞ ػ‬root directory ‫٘زا‬ . C:/ foo/bar/readme.txt ً‫ ِض‬path nameٍٝ‫ ٨ ٠ؾزٛٞ ػ‬FreeBSD a1,a2 as other directories ٖ‫ 3 ٚوً ُِٕٙ ػٕذ‬file System A,B and C ‫افزشع أٔه ػٕذن‬ . B and C ‫ٚوزٌه‬ .ً‫ وّب ثبٌشى‬root file system ٛ٘ A ْٛ‫ع١ى‬ a1 ‫ ثـ‬B ‫ .ع١غزجذي‬a1 directory ٍٝ‫ ٌٗ ػ‬mount ًّ‫ ٚ ٔمَٛ ثؼ‬B ‫صُ ٔفشع أْ أؽؼشٔب‬ :ٟ‫ٚع١ظٙش اٌشىً و٥ر‬ 14
  • 15. ‫وً اٌٍّفبد اٌّٛعٛدح فٟ 2‪ّ٠ b1 , b‬ىٓ اٌٛطٛي اٌ١ٗ ػٓ ؽش٠ك 2‪/a1/b1 or /a1/b‬‬ ‫ٚوً اٌٍّفبد اٌّٛعٛدح فٟ 1‪ a‬رُ اخفبء٘ب ِؤلذ ,ٚع١زُ اظٙبس٘ب إرا لّٕب ‪unmount for‬‬ ‫1‪.B from a‬‬ ‫ٚ٠ّىٓ ا٠ؼب اْ ٔمَٛ ثـ ‪ mount for C‬إٌٝ 1‪ b‬ف١ىْٛ و٥رٟ:‬ ‫أٚ ٔمَٛ ثـ ‪ mount for C‬إٌٝ ‪ِ A‬جبششح و٥رٟ:‬ ‫51‬
  • 16. ‫إٔه رمَٛ ثئػذاد ‪ File Systems‬ػٕذِب رمَٛ ثـ ‪ ٨ٚ FreeBSD installation‬رمَٛ ثزغ١شُ٘ إٌٝ‬ ‫إرا لّذ ثبػبفخ ‪. new disk‬‬ ‫ٕٚ٘بن ِضا٠ب ٚػ١ٛة ٨عزؼّبي ‪. one big file system‬‬ ‫ِضا٠ب اعزخذاَ ‪: multiple file system‬‬ ‫‪ّ٠ٚ ‬ىٕٗ اػطبئه ِخزٍف اٌخ١بساد ‪ for mounting‬ػٍٝ عج١ً اٌّضبي ، ِغ اٌزخط١ؾ‬ ‫اٌذل١ك ، ٠ّىٓ رشو١جٗ ػٍٝ ‪ root file system‬وأٔٗ ‪ِّ ، read-only‬ب ٠غؼً ِٓ‬ ‫اٌّغزؾ١ً ثبٌٕغجخ ٌه ٌؾزف ػٓ غ١ش لظذ أٚ رؼذ٠ً ٍِف ؽشعخ.‬ ‫وّب اْ فظً ‪ّٕ٠ writable file systems‬غ ‪ suid and guid bits‬اْ رؾذس رغ١ش ِّب‬ ‫٠ؼذٞ اٌّض٠ذ ِٓ اٌؾّب٠خ.‬ ‫‪٠ FreeBSD ‬ؾغٓ رٍمبئ١ب رخط١ؾ اٌٍّفبد ػٍٝ ‪ ،file system‬اػزّبدا ػٍٝ و١ف١خ‬ ‫اعزخذاَ ‪ٚ File system‬ػٍٝ ٘زا فئْ ٔظبَ اٌٍّفبد اٌزٟ رؾزٛٞ ػٍٝ اٌؼذ٠ذ ِٓ‬ ‫اٌٍّفبد اٌظغ١شح اٌزٟ رزُ وزبثزٙب ثشىً ِزىشس ع١ىْٛ ٌٙب رخط١ؾ ِخزٍف ٠ؾزٛٞ‬ ‫ػٍٝ ػذد ألً ِٓ أوجش اٌٍّفبد .ٌٚىٓ ٚعٛد ‪ٚ file system‬اؽذ وج١ش ع١غؼً ٘زا‬ ‫اٌزؾغ١ٓ ٠ٕٙبس.‬ ‫‪ FreeBSD's file systems ‬لٛ٠خ عذا ٚ٠ٕجغٟ أْ رفمذ اٌغٍطخ .ِٚغ رٌه، ٠ّىٓ ٌفمذاْ‬ ‫اٌطبلخ فٟ ٌؾظخ ؽشعخ اٌؼشس ثـٙ١ىً ‪file system‬ػٓ ؽش٠ك رمغ١ُ اٌج١بٔبد ػجش ‪file‬‬ ‫‪ِ systems‬زؼذدح ، ِّب ٠غؼً ِٓ ا٤عًٙ ثبٌٕغجخ ٌه ٨عزؼبدح ِٓ إٌغخخ‬ ‫ا٨ؽز١بؽ١خ ‪ backup‬ؽغت اٌؼشٚسح.‬ ‫ِضا٠ب اعزخذاَ ‪: single file system‬‬ ‫‪ٌٙ File systems ‬ب ؽغُ صبثذ .إرا لّذ ثئٔشبء ‪ file system‬ػٕذ ‪FreeBSD installation‬‬ ‫ٚاػطبئٙب ؽغُ ِؾذد، لذ رىزشف فٟ ٚلذ ٨ؽك أٔه رؾزبط ٌغؼً ‪ partition‬اوجش .‬ ‫ٚ٘زا ٨ ٠زؾمك ثغٌٙٛخ دْٚ إٌغخ ا٨ؽز١بؽٟ ‪ٚ ،backup‬إػبدح ثٕبء‪ِ file system‬غ‬ ‫اٌؾغُ اٌغذ٠ذ، صُ اعزؼبدح اٌج١بٔبد‬ ‫61‬
  • 17. ِٓ ‫ ِغبؽخ‬FreeBSD َ‫ , ٠مذ‬swap spaceً‫ ٠غزخذَ أ٠ؼب ِغبؽخ ِٓ أع‬FreeBSD ‫اٌزاوشح ا٨فزشاػٟ ,٠غّؼ ٘زا اٌىّج١ٛرش اٌزظشف وّب ٌٛ أْ ِغبؽزٗ أوضش ِٓ اٌزاوشح‬ ‫اٌّٛعٛدح ػٕذِب رٕفذ اٌزاوشح رزؾشن ثؼغ اٌج١بٔبد اٌزٟ ٨ رغزخذَ ؽبٌ١ب إٌٝ اٌزاوشح‬ .‫ا٨فزشاػ١خ‬ : ‫ ٚثؼغ ا٨رفبل١بد اٌّشرجطخ ثٙب‬partitions ‫ثؼغ‬ Partition Convention A Normally contains the root file system B Normally contains swap space C Normally the same size as the enclosing slice. This allows utilities that need to work on the entire slice (for example, a bad block scanner) to work on the c partition. You would not normally create a file system on this partition. D Partition d used to have a special meaning associated with it, although that is now gone and d may work as any normal partition. .‫ شش٠ؾخ‬slice ٝ‫ ٠ذػ‬file system ٍٝ‫ ٠ؾزٛٞ ػ‬partition ً‫و‬ FreeBSD from UNIX ‫، ِٚشح أخشٜ، ٚ٘زا ٘ٛ ثغجت اسرجبؽ‬FreeBSD ‫ ٘ٛ ِظطٍؼ‬Slice .4 ٌٝ‫ ٠زُ رشل١ُ اٌششائؼ، اثزذاء ِٓ 1 إ‬background ُ‫ٚأخ١شا، ٠ زُ رؾذ٠ذ وً لشص ػٍٝ إٌظبَ اعُ اٌمشص ٠جذأ ِغ سِض ٠ش١ش إٌٝ ٔٛع اٌمشص، ص‬ ُ‫ ، اٌمشص رشل١ُ ٠جذأ فٟ 0 ٠ز‬slides ‫ػذد، ِش١شا إٌٝ اٌمشص اٌزٞ ٘ٛ ػٍ١ٗ .ٚػٍٝ ػىظ‬ :‫عشد اٌشِٛص اٌّشزشوخ اٌزٟ عٛف رشا٘ب فٍغذٚي‬ Code Meaning Ad ATAPI (IDE) disk Da SCSI direct access disk Acd ATAPI (IDE) CDROM Cd SCSI CDROM Fd Floppy disk : ‫ِضبي‬ Name Meaning Ad0s1a The first partition (a) on the first slice (s1) on the first IDE disk (ad0). Da1s2e The fifth partition (e) on the second slice (s2) on the second SCSI disk (da1). 17
  • 18. ٍٝ‫ ٌج١ئخ رطٛ٠ش ِزىبٍِخ اٌمشص ا٤ٚي رؼٍك ػ‬FreeBSD ‫٠ظٙش ٘زا اٌشعُ اٌج١بٟٔ ػشع‬ 2 ‫إٌظبَ. ٔفزشع أْ اٌمشص ٘ٛ 4 غ١غب ثب٠ذ فٟ اٌؾغُ ، ٚ٠ؾزٛٞ ػٍٝ اصٕ١ٓ ِٓ ششائؼ‬ ٞٛ‫ ٚ٠ؾز‬c:،MS-DOS disk ٍٝ‫). اٌشش٠ؾخ ا٤ٌٚٝ رؾزٛٞ ػ‬MS-DOS partitions( ‫غ١غبثب٠ذ‬ .swap partition ٚ ،‫. ٌٗ ص٩صخ ألغبَ اٌج١بٔبد‬FreeBSD instllation ‫ػٍٝ شش٠ؾخ اٌضبٔ١خ‬ e for /var directory ، A for root file system , file system َ‫ٚع١ىْٛ ثبٌض٩صخ ألغب‬ . f for /usr directory hierarchy ٚ hierarchy 18
  • 19. Mounting and Unmounting File Systems 1.1 ‫ وفشٚع اٌزٟ ٠ّىٓ اْ ٠ىْٛ ٌٙب‬directories ٟ‫ ٘ٛ وٍشغشح ٚثبل‬file system ًٌ ‫أفؼً ٚطف‬ .‫ٟ٘ ا٠ؼب فشٚع خبطخ ثٙب‬ . file systems ٟ‫ ف‬directories ً‫ٕٚ٘بن أعجبة ػذ٠ذح ٌفظ‬ ‫/ ٘ٛ شٟء‬var form / ً‫ ٌ١ظ فىشٖ ع١ذٖ ٌزٌه فئْ فظ‬root file system ٥ِ ْ٤ ٨ٚ‫أ‬ .ً‫ِفؼ‬ The fstab File 1.1.1 .‫ رٍمبئ١ب‬mounting ‫/ ٚ٠ؾذس‬etc/fstab ٟ‫ رىْٛ ف‬file systems , booting ‫خ٩ي ػٍّ١خ‬ :ٗ١ٌ‫/ ٠ؾزٛٞ ػٍٝ لبئّٗ ِٓ اٌغطٛس ٌٙب اٌظ١غخ اٌزب‬etc/fstab device /mount-point fstype options dumpfreq passno device A device name (which should exist) Mount-point A directory (which should exist), on which to mount the file system. Fstype The file system type to pass to mount. The default FreeBSD file system is ufs. Options Either rw for read-write file systems, or ro for read-only file systems, followed by any other options that may be needed. A common option is noauto for file systems not normally mounted during the boot sequence. Other options are listed in the mount(8) manual page. Dumpfreq This is used by dump(8) to determine which file systems require dumping. If the field is missing, a value of zero is assumed. passno This determines the order in which file systems should be checked. File systems that should be skipped should have their passno set to zero. The root file system (which needs to be checked before everything else) should have its passno set to one, and other file systems' passno should be set to values greater than one. If more than one file systems have the same passno then fsck(8) will attempt to check file systems in parallel if possible. 19
  • 20. The mount Command 1.1.1 ٗ‫أوضش ؽش٠مٗ ِؼشٚف‬ # mount device mountpoint : ‫ٕ٘بن اٌؼذ٠ذ ِٓ ا٦خز١بساد ٌٚىٓ أشٙش٘ب‬ -a Mount all the file systems listed in /etc/fstab. Except those marked as “noauto”, excluded by the -t flag, or those that are already mounted. -d Do everything except for the actual mount system call. This option is useful in conjunction with the -v flag to determine what mount(8) is actually trying to do. -f Force the mount of an unclean file system (dangerous), or forces the revocation of write access when downgrading a file system's mount status from read-write to read-only. -r Mount the file system read-only. This is identical to using the ro argument to the -o option. -t fstype Mount the given file system as the given file system type, or mount only file systems of the given type, if given the -a option. “ufs” is the default file system type. -u Update mount options on the file system. -v Be verbose. -w Mount the file system read-write. -o option takes a comma-separated list of the options, including the following: Noexec Do not allow execution of binaries on this file system. This is also a useful security option. Nosuid Do not interpret setuid or setgid flags on the file system. This is also a useful security option. The unmount Command 1.1.1 . file system ‫ ٠ّىٕٗ رذِ١ش اٌىّج١ٛرش أٚ اٌج١بٔبد ػٍٝ اي‬unmounting file systems ‫وش٘ب‬ .unmount all mounted file systems ‫- رغزخذَ ي‬A ٚ-a : ‫ٍِؾٛظخ‬ . file systemًٌ unmount ‫٨ رمَٛ ثـ‬ 21
  • 21. ‫1.1 ‪Processes‬‬ ‫‪ٔ ٛ٘ FreeBSD‬ظبَ رشغ١ً ِزؼذد اٌّٙبَ .ٚ٘زا ٠ؼٕٟ أٔٗ ٠جذٚ وّب ٌٛ أْ أوضش ِٓ ثشٔبِظ‬ ‫ٚاؽذ ٘ٛ اٌزٞ ٠شزغً فٟ آْ ٚاؽذ .ٚ٠غّٝ وً ثشٔبِظ ٠ؼًّ فٟ ٔفظ اٌٛلذ ػٍّ١خ‬ ‫‪, process‬فئْ وً أِش ٠جذء ٠شغ ً ػٍٝ ا٤لً ػٍّ١خ عذ٠ذح، ٕٚ٘بن ػذد ِٓ اٌؼٍّ١بد اٌزٟ‬ ‫رمَٛ ثزشغ١ً إٌظبَ فٟ وً ٚلذ ٚ٨ رزٛلف ، ٚاٌؾفبظ ػٍٝ إٌظبَ ٠ؼًّ.‬ ‫٠زُ اٌزؼشف ثشىً فش٠ذ وً ػٍّ١خ ثٛاعطخ ػذد ٠غّٝ ِؼشف اٌؼٍّ١خ، أٚ ‪ِٚ ،PID‬ضً‬ ‫اٌٍّفبد، وً ػٍّ١خ ٌٙب ِبٌه ٚاؽذ ِٚغّٛػخ .٠زُ اعزخذاَ اٌّؼٍِٛبد اٌّبٌه ٚاٌّغّٛػخ‬ ‫ٌزؾذ٠ذ ِب ٟ٘ اٌٍّفبد ٚا٤عٙضح اٌزٟ ٠ّىٓ أْ رفزؼ ، ٚرٌه ثبعزخذاَ ‪. permissions‬‬ ‫ِؼظُ اٌؼٍّ١بد ٌٙب ػٍّ١خ اطٍ١ٗ . ٚػٍّ١خ ا٤طٍ١خ ٟ٘ اٌؼٍّ١خ اٌزٟ ثذأد ِٕٙب .ػٍٝ‬ ‫عج١ً اٌّضبي، إرا وٕذ رىزت ا٤ٚاِش إٌٝ ‪ shell‬فٟٙ ػٍّ١خ ، ٚأ٠خ أٚاِش رشغ١ً اخشٜ رىزجٙب‬ ‫ٟ٘ ػٍّ١بد ٟ٘ أ٠ؼب .ٚ وً ػٍّ١خ ف١ غ١ىْٛ ‪ ٟ٘ shell‬اطٍٙب . اعزضٕبء ‪process called‬‬ ‫)‪ ٛ٘ (init‬دائّب أٚي ػٍّ١خ، ٌزٌه ‪ٌٙ PID‬ب ٟ٘ دائّب 1 .ثذء ‪INIT‬رٍمبئ١ب ثٛاعطخ ٔٛاح‬ ‫‪ FreeBSD Kernel‬ػٕذِب ٠جذأ إٌظبَ.‬ ‫ٕ٘بن اِشاْ ِّٙبْ ٌّؼشفخ اٌؼٍّ١بد ػٍٝ اٌغٙبص ‪ , PS and top‬أِش ‪٠ ps‬غزخذَ ٌؼشع‬ ‫لبئّخ صبثزٗ ثبٌؼٍّ١بد اٌغبس٠خ.‬ ‫أِش ‪ top‬وً اٌؼٍّ١بد اٌغبس٠خ ٚرؼذ٠ٍٙب وً ثؼغ صٛأٟ ٌزٌه ٠ّىٕه ِزبثؼخ اخش اٌزؼذ٠٩د.‬ ‫:‪Example‬‬ ‫‪% ps‬‬ ‫‪PID‬‬ ‫‪STAT‬‬ ‫‪TT‬‬ ‫‪TIME‬‬ ‫‪COMMAND‬‬ ‫892‬ ‫0‪P‬‬ ‫‪Ss‬‬ ‫01.10:0‬ ‫‪Tcsh‬‬ ‫8707‬ ‫0‪P‬‬ ‫‪S‬‬ ‫88.04:2‬ ‫‪xemacs mdoc.xsl‬‬ ‫)41.1.12-‪(xemacs‬‬ ‫39373‬ ‫0‪P‬‬ ‫‪I‬‬ ‫11.30:0‬ ‫‪xemacs freebsd.dsl‬‬ ‫)41.1.12-‪(xemacs‬‬ ‫03684‬ ‫0‪P‬‬ ‫‪S‬‬ ‫-‪2:50.89 /usr/local/lib/netscape‬‬ ‫-‪linux/navigator-linux‬‬ ‫‪4.77.bi‬‬ ‫03784‬ ‫0‪P‬‬ ‫‪Iw‬‬ ‫0.00:0‬ ‫)‪(dns helper‬‬ ‫)-‪(navigator-linux‬‬ ‫01227‬ ‫0‪P‬‬ ‫+‪R‬‬ ‫00.00:0‬ ‫‪Ps‬‬ ‫12‬
  • 22. 390 P1 Is 0:01.14 Tcsh 7059 P2 Is+ 1:36.18 /usr/local/bin/mutt -y 6688 P3 Iws 1:36.18 Tcsh 10735 P4 Iws 0:00.00 Tcsh 20256 P5 Iws 0:00.00 Tcsh 262 V0 Iws 0:00.00 -tcsh (tcsh) 270 V0 Iws 0:00.00 /bin/sh /usr/X11R6/bin/startx - - -bpp 16 280 V0 Iw+ 0:00.00 xinit /home/nik/.xinitrc -- -bpp 16 284 V0 Iw+ 0:00.00 /bin/sh /home/nik/.xinitrc 285 V0 s 0:38.45 /usr/X11R6/bin/sawfish ٛ٘ . PID ‫ إٌٝ ػذد ِٓ ا٤ػّذح‬PS (1) ِٓ ‫وّب رشْٚ فٟ ٘زا اٌّضبي ، ٠زُ رٕظ١ُ ا٦خشاط‬ ،99999 ٌٝ‫ ثذءا ِٓ 1 ، رشرفغ إ‬PIDS ٓ١١‫ِ ؼشف ػٍّ١خ ثؾش فٟ ٚلذ عبثك . ٠زُ رؼ‬ TT ‫ إرا وبْ ثبٌفؼً ل١ذ ا٨عزخذاَ . اٌؼّٛد‬PIDS ‫ٚ٠ٍزف ؽٛي اٌؼٛدح إٌٝ ثذا٠خ ػٕذ ٔفبد‬ ‫ ٠ج١ٓ ؽبٌخ‬STAT . ٓ٘‫ اٌجشٔبِظ ٠ؼًّ ٚ ثأِبْ ٠ّىٓ رغبٍ٘ٙب فٟ اٌٛلذ اٌشا‬TTY ٓ١‫٠ج‬ ‫ ٘ٛ ِمذاس اٌٛلذ اٌزٞ رُ رشغ١ً اٌجشٔبِظ‬TIME ْ‫اٌجشٔبِظ، ِٚشح أخشٜ ،٠ّىٓ رغبٍ٘ٙب ثأِب‬ CPU --.ٟ‫ف‬ 22
  • 23. : top ‫ِضً آخش ػٍٝ أِش‬ % top last pid: 72257; load averages: 0.13, 0.09, 0.03 up 0+13:38:33 22:39:10 47 processes: 1 running, 46 sleeping CPU states: 12.6% user, 0.0% nice, 7.8% system, 0.0% interrupt, 79.7% idle Mem: 36M Active, 5256K Inact, 13M Wired, 6312K Cache, 15M Buf, 408K Free Swap: 256M Total, 38M Used, 217M Free, 15% Inuse USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND PID top nik 28 0 1960K 1044K RUN 0:00 14.86% 1.42% 72257 xemacs-21.1.14 nik 2 0 15280K 10960K select 2:54 0.88% 0.88% 7078 XF86_SVGA nik 2 0 18636K 7112K select 5:36 0.73% 0.73% 281 ً١‫ ِٓ ػٍّ١خ ِشبسوخ ٌزشغ‬PID ٓ١‫٠زُ رمغ١ُ ا٦ٔزبط إٌٝ لغّ١ٓ .أٚي خّغخ أعطش ٠ج‬ . َ‫ٚرؾّ١ً إٌظب‬ ‫اٌغضء اٌزٞ ٠ٍ١ٗ ٟ٘ عٍغٍخ ِٓ ا٤ػّذح اٌزٟ رؾزٛٞ ػٍٝ ِؼٍِٛبد ِشبثٙخ ٌّب خشط‬ PID, the username, the amount of CPU time ً‫ وّب وبْ ِٓ لجً ِض‬PS (1). ِٓ taken, and the command that was run 23
  • 24. ‫‪1.7 Daemons, Signals, and Killing Processes‬‬ ‫ػٕذ رشغ١ً ِؾشسا ِٓ اٌغًٙ اٌغ١طشح ػٍٝ اٌّؾشس ، ٚ رغؼٍٗ رٌه ٌزؾّ١ً اٌٍّفبد ،‬ ‫ٍُٚ٘ عشا . ٠ّىٕه اٌم١بَ ثزٌه ٤ْ اٌّؾشس ٠مذَ رغٙ١٩د ٌٍم١بَ ثزٌه ، ٚ٤ْ اٌّؾشس ِشفك‬ ‫ػٍٝ ‪٠ ٌُ .terminal‬زُ رظّ١ُ ثؼغ اٌجشاِظ ٌ١زُ رشغ١ٍٙب ِغزّشح ِغ ِذخ٩د‬ ‫اٌّغزخذَ ، ٚؽزٝ أٔٙب رمطغ ا٦رظبي فٟ أٚي فشطخ .ػٍٝ عج١ً اٌّضبي ، خبدَ اٌٛ٠ت‬ ‫٠مؼٟ ؽٛي اٌ١َٛ ٌ ٩عزغبثخ ٌٍطٍجبد ػٍٝ شجىخ ا٦ٔزشٔذ ، فئٔٗ ػبدح ٨ ٠ؾزبط اٌٝ أٞ‬ ‫ِغبّ٘خ ِٕه . ثشاِظ اٌجش٠ذ ا٦ٌىزشٟٚٔ ٟ٘ ِضبي ػٍٝ ٘زا إٌٛع ِٓ اٌزطج١ك ا٠ؼب.‬ ‫ٔؾٓ ٔطٍك ػٍٝ ٘زٖ اٌجشاِظ ‪ٚ. daemons‬وبٔذ ‪ daemons‬ؽشفب فٟ ا٤عبؽ١ش اٌ١ٛٔبٔ١خ :‬ ‫رؼٕٟ ٨ خ١ش أٚ شش، ، إٌٝ ؽذ وج١ش ، ٚفؼٍذ اش١بء ِف١ذح ٌٍجشش٠خ ، ِضً اٌىض١ش ِٓ خٛادَ‬ ‫اٌٛ٠ت ٚخٛادَ اٌجش٠ذ ِٓ اٌ١َٛ رفؼً أش١بء ِف١ذح.‬ ‫فٟ ثؼغ ا٤ؽ١بْ عزؾزبط ٌ٧رظبي ثبي ‪ّ٠, daemon process‬ىٓ رٌه ػجش اْ رجؼش ٌٙب‬ ‫‪ٕ٘, signal‬بن اٌؼذ٠ذ ِٓ أٔٛاع اي ‪ّ٠ ٨ٚ, signals‬ىٕه اْ رجؼش ‪ signal‬إ٨ ًٌ ‪process‬اٌزٟ‬ ‫رٍّىٙب.‬ ‫ع١مَٛ ‪ FreeBSD‬ثجؼذ .‪ signals to apps‬فٟ ثؼغ اٌؾب٨د ,إرا وزت ثشٔبِظ ثطش٠مخ ع١ئخ‬ ‫, ٠مَٛ ‪ FreeBSD‬ثبسعبي )‪. segmentation violation signal (sigsegv‬‬ ‫ٕ٘بن ‪ two signals‬رغزخذَ ٦٠مبف اٌؼٍّ١ٗ, ‪ ٛ٘ SIGKILL. SIGTERM‬اوضش ؽش٠مخ إِٔٗ‬ ‫ٌٛلف اٌؼٍّ١ٗ ‪. Killing process‬ؽ١ش ٠ّىٓ ٌٍؼٍّ١ٗ اْ رٍزمؾ اي ‪ٚsignal‬رفُٙ أٔه رشد اْ‬ ‫رغٍك اٌؼًّ.‬ ‫‪ّ٠ ٨ SIGKILL‬ىٓ رغبٍ٘ٗ ثٛاعطخ اٌؼٍّ١ٗ ‪ , process‬إرا اسعٍذ ٘زٖ )‪signal (SIGKILL‬‬ ‫ع١مَٛ ‪ FreeBSD‬ثغٍك اٌؼٍّ١ٗ فٛسا.‬ ‫ثؼغ اي ‪ signals‬اٌزٟ ٠ّىٓ اْ رؾزبعٙب ا٠ؼب ٟ٘ 2‪SIGHUP ,SIGUSR1 and SIGUSR‬‬ ‫ؽ١ش ٠ّىٕه اعزخذاَ ‪ٌ SIGHUP‬غؼً اي ‪ process‬رؼ١ذ لشاءح ٍِف اٌزؼذ٠٩د ثذ٨ ِٓ‬ ‫ا٠مبف اٌخذِٗ ٚرشغ١ٍٙب ِٓ عذ٠ذ.‬ ‫42‬
  • 25. :ً‫ وّب ثبٌّض‬signal to kill a process ‫٠ّىٕه اسعبي‬ ‫ ,ٚٔغؼً ٘زا اٌٍّف ٠مشا‬signal to (inetd configuration file) ً‫٘زا اٌّضبي ٠ظٙش و١ف رشع‬ . SIGHUP َ‫اٌزؼذ٠٩د ثبعزخذا‬ ‫ اٌزٞ ٠مَٛ ثبٌجؾش‬grep command ‫ ٚا٠ؼب‬PS command َ‫ ثبعزخذا‬PID ‫1-٠غت ِؼشفخ‬ .ٓ١‫ ِؼ‬string ٓ‫فٟ ِخشعبد ػ‬ % ps –ax | grep inetd 198 ?? IWs 0:00.00 inetd –Ww 198 ٛ٘ PID ْ‫إر‬ su َ‫ ٠غت اعزخذا‬root ‫ ٠غزخذَ ثٛاعطخ‬inetd ْ‫ ,ٚثغجت ا‬signal ‫ ٨سعبي‬kill َ‫2-اعزخذ‬ .٨ٚ‫ أ‬root ‫ٌ١ظجؼ‬ % su Password: # /bin/kill -s HUP 198 ‫ ٌؼٍّ١ٗ أذ‬KILL ‫ ٔبعؼ ٌٚىٓ إرا لّذ ثـ‬KILL ْ‫فٟ ِؼظُ ا٤ٔظّخ ٨ رظٙش ٌه أٞ سعبٌٗ ثب‬ :‫٨ رٍّىٙب ع١ؼشع‬ “kill: PID: Operation not permitted” :‫ٍِؾٛظخ‬ : init ,process ID 1 ٟ‫ ثؼشٛائ١خ ٠ّىٓ اْ رىْٛ فىشٖ ع١ئخ خبطخ ف‬KILL signal َ‫اعزخذا‬ /bin/kill -s KILL 1 .ٖ‫٘زٖ ؽش٠مٗ عش٠ؼٗ ٌزغٍك ثٙب إٌظبَ وٍٗ ,ٌزٌه رأوذ ع١ذا ِٓ ِبرىزجٗ لجً رٕف١ز‬ 25
  • 26. Shells 1.8.1 ّٝ‫ ا٤ٚاِش ٠غ‬cmd ‫ ٠زُ اٌىض١ش ِٓ اٌؼًّ اٌ١ِٟٛ ثئعزخذاَ ٚاعٙخ عطٛس‬FreeBSD ٟ‫ف‬ ‫ اٌشئ١غ١خ رزّضً فٟ ارخبر ا٤ٚاِش ِٓ لٕبح اٌّذخ٩د ٚرٕف١ز٘ب .ٕٚ٘بن‬Shell ‫ ,ٚظ١فخ‬Shell ‫ لذ ثٕ١ذ أ٠ؼب فٟ ٚظبئف ٌٍّغبػذح فٟ اٌّٙبَ اٌ١ِٛ١خ ِضً إداسح‬Shells ِٓ ‫اٌىض١ش‬ .‫اٌٍّفبد‬ C-‫ ٠ّىٓ اعزخذاِٙب أفؼً فٕٙبن اٌىض١ش ِٓ ا٨ٔٛاع, ِض٩ إرا وٕذ‬Shell ٞ‫إرا وٕذ ِزؾ١ش أ‬ ‫ ٠ّىٕه‬Linix ِٟ‫ ,ٚارا وٕذ ِٓ ِغزخذ‬tcsh shell َ‫ ٠ّىٓ اعزخذا‬programmer . bash shell َ‫اعزخذا‬ tab ‫ ٟٚ٘ وزبثخ ِمذِخ اٌىٍّخ صُ ػغؾ‬intelligence sense ‫٠ّىٕه اعزخذاَ خذِخ‬ . rem [tab] ‫ رىزت‬remove ‫٨عزىّبي اٌىٍّٗ. ِض٩ ٌىزبثخ أِش‬ :ُ٘‫ٚ٘بٟ٘ لبئّٗ ثأُ٘ اٌّزغ١شاد ِٚؼٕب‬ variables Description USER Current logged in user's name. PATH Colon-separated list of directories to search for binaries. DISPLAY Network name of the X11 display to connect to, if available. SHELL The current shell. TERM The name of the user's type of terminal. Used to determine the capabilities of the terminal. TERMCAP Database entry of the terminal escape codes to perform various terminal functions. OSTYPE Type of operating system. e.g., FreeBSD. MACHTYPE The CPU architecture that the system is running on. EDITOR The user's preferred text editor. PAGER The user's preferred text pager. MANPATH Colon-separated list of directories to search for manual pages. 26
  • 27. Changing Your Shell 1.8.1 . chsh ‫ اٌّغزخذِخ ثبعزخذاَ أِش‬Shell ‫أعًٙ ؽش٠مٗ ٌزغ١ش‬ ٟ‫ ثذْٚ اعجبسن ػٍٝ دخٛي ف‬Shell ‫– ,ٚ٘زا ع١مَٛ ثزغ١١ش‬s in the chsh ‫٠ّىٕه ا٠ؼب اػطبء‬ .‫اٌّؾشس‬ :ٟ‫ عزىزت ا٢ر‬bash ٌٝ‫ِض٩ إرا اسدد اٌزغ١١ش إ‬ % chsh -s /usr/local/bin/bash :‫ٍِؾٛظخ‬ :ٟ‫ ٠ذٚ٠ب عزؾزبط إٌٝ ػًّ ا٨ر‬Shell ً٠‫إرا لّذ ثزٕض‬ :ٟ‫/ عزؾزبط إٌٝ ا٨ر‬usr/local/bin ٟ‫ ٠ذٚ٠ب ف‬bash ‫ِض٩ إرا ٚػؼذ‬ # echo "/usr/local/bin/bash" >> /etc/shells Then return chsh 27
  • 28. ‫‪1.9 Text Editor‬‬ ‫ٚ٠ؾذس اٌىض١ش ِٓ اٌزؼذ٠٩د فٟ ‪ FreeBSD‬ػٓ ؽش٠ك اٌزؼذ٠ً فٟ ٍِفبد ٔظ١خ .ٚثغجت‬ ‫٘زا، فئٔٗ ع١ىْٛ فىشح ع١ذح ٌزظجؼ ِأٌٛفب ِغ ِؾشس إٌض ‪.text editor‬‬ ‫ٚأثغؾ ِؾشس ٌٍزؼٍُ ٘ٛ ِؾشس ٠ذػٝ ‪ ،ee‬اٌزٟ ٟ٘ اخزظبس ‪ِ easy editor‬ؾشس‬ ‫أعًٙ‬ ‫عًٙ .ٌجذء ‪ّ٠ ،ee‬ىٓ ٤ؽذ أ ْ ٠ىزت أِش ‪ ee filename‬ؽ١ش ‪ ٛ٘ filename‬اعُ اٌٍّف‬ ‫اٌّشاد رؾش٠شٖ .ػٍٝ عج١ً اٌّضبي ، ٌزؾش٠ش ‪ ، /etc/rc.conf‬اوزت فٟ ‪ِ /etc/conf ee‬شح ٚاؽذح‬ ‫ِٓ داخً ‪٠ ، ee‬زُ عشد وبفخ ا٤ٚاِش ٌّؼبٌغخ ِٙبَ اٌزؾش٠ش فٟ أػٍٝ اٌشبشخ .اٌؾشف ^‬ ‫٠ّضً ِفزبػ ‪ ctrl‬ػٍٝ ٌٛؽخ اٌّفبر١ؼ، ثؾ١ش ‪ٛ٠ ^e‬عغ اٌغ١طشح ػٍٝ رشو١جخ اٌّفبر١ؼ.‬ ‫ٌّغبدسح ‪ ،ee‬اػغؾ ِفزبػ ‪ ،esc‬صُ اخز١بس ‪ٚ leave editor‬عٛف ٠طبٌجه اٌ ّؾشس ثـؾفع أ٠خ‬ ‫رغ١١شاد إرا رُ رؼذ٠ً اٌٍّف.‬ ‫وّب ٠ٛعذ ثبي ‪ِ FreeBSD‬ؾشساد ألٜٛ ِضً ‪ vi‬وغضء ِٓ إٌظبَ ا٤عبعٟ, فٟ ؽ١ٓ اْ‬ ‫ِؾشسح اخشٜ ِضً ‪ ُ٘ Emacs and vim‬عضء ِٓ اي ‪.Ports collection‬‬ ‫٘زٖ اٌّؾشساد رٛفش ٚظبئف أوضش ِٓ رٌه ثىض١ش، ٚاٌمٖٛ رغؼٍٙب أوضش رؼم١ذا ٌٍزؼٍُ .ٌٚىٓ إرا‬ ‫وٕذ رخطؾ ٌزفؼً اٌىض١ش ِٓ رؾش٠ش إٌض، ٚاٌزؼٍُ ِؾشس ألٜٛ ِضً ‪Emacs or vim‬ع١ٛفش‬ ‫ٌه ٚلزب أؽٛي ثىض١ش فٟ اٌّذٜ اٌطٛ٠ً.‬ ‫82‬
  • 29. ‫‪1.10.1 Devices and Device Nodes‬‬ ‫رؼش٠ف ‪ّ٠ Device‬ىٓ اْ ٠ىْٛ ِظطٍؼ ٠غزخذَ فٟ اٌغبٌت ٤ٔشطخ راد اٌظٍخ ثـ ‪hardware‬‬ ‫فٟ ٘زا إٌظبَ ، ثّب فٟ رٌه ا٤لشاص، ٚاٌطبثؼبد، ٚثطبلبد اٌشعِٛبد ، ٌٚٛؽبد اٌّفبر١ؼ .‬ ‫ػٕذِب ٠ذخً ‪ FreeBSD‬فٟ ِشؽٍخ ‪ِ ،booting‬ؼظُ ِب ٠مَٛ ثٗ ‪ ٛ٘ FreeBSD‬اٌىشف ػٓ‬ ‫ا٤عٙضح اٌّٛطٌٛخ . ٠ّىٕه أْ رجؾش ِٓ خ٩ي سعبئً ‪ِ booting‬شح أخشٜ ػٓ ؽش٠ك وزبثخ‬ ‫‪/var/run/dmesg.boot‬‬ ‫‪1.10.2 Creating Device Nodes‬‬ ‫ػٕذ إػبفخ عٙبص عذ٠ذ إٌٝ إٌظبَ اٌخبص ثه، أٚ عّغ ٌ ذػُ أعٙضح إػبف١خ، ٠غت إٔشبء‬ ‫‪ Device Node‬عذ٠ذ.‬ ‫)‪1.10.2.1 DEVFS (DEVice File System‬‬ ‫رّذن ‪ DEVFS‬ثئِىبٔ١خ اٌذخٛي إٌٝ ‪ Kernel's device namespace‬فٟ ‪global file system‬‬ ‫‪. namespace‬‬ ‫ثذ٨ ِٓ رىٛ٠ٓ أٚ رؼذ٠ً ‪٠, device node‬مَٛ ‪ DEVFS‬ثزؼذ٠ٍٙب خبطخ ٌه.‬ ‫92‬
  • 30. ‫11.1 ‪Binary Formats‬‬ ‫٠غزخذَ ‪ FreeBSD‬اي ‪ٌٚ elf format‬ىٓ أٚ٨ ٠غت ِؼشفخ ص٩س ‪ formats‬اعبع١١ٓ فٟ‬ ‫‪UNIX‬‬ ‫1- ‪a.out‬‬ ‫ألذَ ‪٠ format‬غزخذِٗ ‪٠ . UNIX‬غزخذَ ‪ header‬لظ١ش ِٚؼغٛؽ ٚسلُ ِّ١ض ٌ١ّ١ض‬ ‫اي ‪٠ٚ, format‬غزخذَ ص٩س ‪ِ segment‬ؾٍّخ :‬ ‫‪Text ,data and .bss‬ثب٦ػبفخ إٌٝ عذٚي اٌشِض ٚ ‪.string table‬‬ ‫2- ‪coff‬‬ ‫‪٠ , SVR3 object format‬ؾزٛٞ اي ‪ header‬ػٍٝ ‪ section table‬ؽ١ش ٠ّىٕه ا٢ْ اْ رؾظً‬ ‫ػٍٝ اوضش ِٓ ‪. .text ,.data and .bss sections‬‬ ‫3- ‪elf‬‬ ‫‪ ٛ٘ ELF‬أوضش رؼج١شا ِٓ ‪٠ ٚ a.out‬غّؼ ٌّض٠ذ ِٓ اٌزّذد فٟ إٌظبَ ا٤عبعٟ .وّب اْ‬ ‫أدٚاد ‪ ELF‬أفؼً فٟ اٌظ١بٔخ ، ٚرمذ٠ُ اٌذػُ ، ٚ٘ٛ أِش ُِٙ ٌىض١ش ِٓ إٌبط. ‪ ELF‬لذ ٠ىْٛ‬ ‫أثطأ لٍ١٩ ِٓ ‪ٌٚ ،a.out‬ىٓ اٌّؾبٌٚخ ٌم١بط ٘زا ٠ّىٓ أْ رىْٛ طؼجخ .ٕ٘بن أ٠ؼب اٌؼذ٠ذ ِٓ‬ ‫اٌزفبط١ً اٌزٟ رخزٍف ث١ٓ اٌزٕغ١م١ٓ)‪ (two formats‬فٟ و١ف١خ رخط١ؾ اٌظفؾبد ،‬ ‫ٚاٌزؼبًِ ِغ ‪ ، INIT code‬اٌخ.‬ ‫٨ شٟء ِٓ ٘زا ُِٙ عذا، ٌىٕٙب أخز٩فبد.‬ ‫13‬