Hi
 
You can use the link below to follow to the Official LM 8.0 directory structure explanation....
 
http://www.mandrakeuser.org/docs/basics/bfiles.html
 
-----Original Message-----
From: alex [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 4:47 AM
To: [EMAIL PROTECTED]
Subject: [newbie] Linux Directory Structure for the Totally Ignorant (rev)

LINUX DIRECTORY STRUCTURE    revised  (for best viewing, use size 10 font)
I was told that the proper word is STRUCTURE but I prefer SYSTEM.  Your choice

One way to get some understanding of  the Linux Directory Structure is to compare it to a typical office filing cabinet.  We'll consider the cabinet as the starting point or root of the office's filing system.   The filing system is divided into drawers that have labels that in some way identify with their contents

Our special  filing cabinet has an identification symbol   /  and its four  drawers are named   '/roundfile',    '/cabinet',  '/stuff', and  '/idontknow'.  Each  drawer contains folders and some documents and all these items have labels for identification.   Some folders contain additional folders and even these may contain more folders with documents here and there.  By having an organized order to these folders and documents, we are able to locate any document by starting with the root of the system, the cabinet, then going to the proper drawer and opening specific folders until we come to the desired document.  Incidentally, the / at the start of each drawername tells us that the drawers belong to the cabinet  ( / )

A Linux Directory Structure  is organized much like the above cabinet.   The difference is, in Linux, we are working with electronic data storage instead of physical data storage.

The  Linux Directory Structure is contained in a huge directory.   Think of this huge directory as an electronic file cabinet that contains all the Linux directories .  Linuxers call it the 'root directory' and identify it with the symbol  ' / '.  It contains electronic drawers which contain electronic folders and electronic documents.   Instead of calling them  cabinet, drawers, and folders,  we'll call all of them directories and instead of documents, we'll say files.

                                                                               /   (the root of the system)
__________________________________|_____________________________________________
     |              |             |              |                |             |             |               |              |               |              |              |            |
/bin       /boot      /dev       /etc       /home      /usr       /mnt       /proc      /root      /sbin      /tmp       /lib       /var

This shows Linux's  standard names of the directories that are like electonic drawers of a cabinet.  These directories are assigned names according to their purpose.  For example,  /dev contains data  for devices such
as  disk drives, modems, and other hardware.

One directory here is named  /root.  This is one of the subdirectories of the root directory (of the system)  labelled  /.     Think of it as our cabinet having a drawer labelled  '/cabinet. (so, when we say 'cabinet' we mean the cabinet and when we say  /cabinet, we mean the drawer   -  /root is like a drawer in the root directory)

/root is a special directory that is allowed to be opened by just one person, Think of it as a drawer that has a combination lock and only one person knows the combination.   We'll call this person  'the root user',  the person in charge of the entire system.

 The 'root user' is the only person who knows the password that will open this directory called   /root.   The 'root user' is the only one who is allowed to manipulate whatever important information is found in  '/root'  to make the computer do what it is supposed to do .

 In Linux lingo, the ' root user ' is more often called just  'root'.  This could make  it difficult sometimes to distinguish between root , the overall directory  ( /  ), and root, the user, but in the lingo, ,    /  is  called the ' root directory.'  So, to emphasize the point,  /root is a subdirectory of the 'root directory and  /root is the private domain of  the user named 'root.   Think, 'root directory' = cabinet,
/root = drawer  and root user  = manager (some Linux mucky-mucks prefer the title 'administrator)

user root is also referred to as the 'superuser' because of root's  power over the whole system

Linux allows more than one user use its facilities.  These users have private directories that are  located in the /home directory.  Each private directory is protected by a password  to prevent other users from using it.  In some situations, there may be so many ordinary users who may generate so much data that the /home directory may contain more folders and data than any other directory, except the root directory, of course.

The only other user who can access these general user's private directories is  'root',  the manager of the Linux system .   ' root ' can and should  register as an ordinary user with  a common user name and assume the role of root only when some action calls for it.   This is to avoid accidental mishaps during routine operation  that could upset the entire Linux system if root did all routine work as root . A mistake as an ordinary user is more likely to harm just that user's data but a mistake by root could shut down  (ruin) the entire Linux System.  Some errors
are correctible but it requires intimate knowledge of the system.

 Ordinary users are allowed to create or delete their own directories and files (with some exceptions) but not another user's.    ' root ' can delete or rename any personal  directory that was created by a regular user. or file anywhere EXCEPT those that are like drawers.  If  'root' switches to operate as an ordinary user, that user does not have the power of root.  That user can switch back to operate as root very easily, when necessary.
 

We'll follow one trail in a directory under  /   ---  /usr  which contains many additional directories, one of which is called /bin and this /bin contains another directory called /control-panel..
 
                                                                                 /
  __________________________________|____________________________________________
     |              |             |              |                |             |             |               |              |               |              |              |            |
/bin       /boot      /dev       /etc       /home     /usr       /mnt       /proc      /root      /sbin      /tmp        /lib        /var
                                                                             | _________________________________|______________________________________________
         |                                |                                           |                                 |                                |                           |
                                                                                                                   /bin                                                    (files)
                                                                                                                       |
                                                                                      ______________|________________
                                                                                         |          |                |               |                |       |
                                                                                                    |
                                                                                               / menu
                                                                                                      |
                                                                   _______________|____________________
                                                                         |                  |                   |                |             |

Notice that the word  'bin' appears twice in the diagram.
There's a  /bin directory directly under  /   and again under  /usr.  It's like a file cabinet have identically named folders in different drawers.  Even though they have identical  labels and contents are basically similar, their exact contents may be different because of where they are located.  Duplicate directory names also occur in other directory chains.

The directory path  in the above example can be expressed like this:

                     /usr/bin/menu/

( the final /  (after menu)  indicates that the list is incomplete so /menu is a directory which means that there's more to the list.
 If the / is absent, the final element is a file of some kind. ( or somebody forgot to include it)
There are some instances where a final directory is normally empty but data may be entered temporarily during the execution of some command.
Some directory chains can be quite lengthy.

Linux documentation sometimes use the terms 'parent diectory' and  'child directory' when referring
to a directory that contains a subdirectory.

WARNING...Even though root has the power to delete or add additional or rename the subdirectories (drawers)of the  root directory, this can upset the system so this is a No No!.  Leave these directories alone.  It's like adding or removing or renaming drawers in a filing cabinet.  Don't do it,. Mister or Ms root, you won't have Linux anymore if you do...

Also, it's unwise to delete or rename any  directories or files unless you're 100% sure there'll be no harm.
Notice, it doesn't say add.  You'll be doing a lot of this and sometimes, you can remove these depending on what they are for.

QUIZ:   (it's OK to look for the answers in the previous text)

1. What is    /root?
         A.  The root directory
         B.   The starting point of the directory system.
         C.   A general purpose directory for any user.
         D.   A subdirectory of the root directory.

2.  What does a Linux  'root directory' most closely resemble
      in an office's file system ?

        A.  One of the drawers of a filing cabinet.
        B.  One of the folders in the drawers of a cabinet.
        C.  The filing cabinet.
        D.  One of the documents in a drawer.

3.   Is a password required to access the root directory?
 
4.   What is the user who manages the entire directory system called.?
 
       A.    /
       B.   boss
       C.   superuser
       D.   root

5.   Which user(s) can access the directory labelled   /   ?
      A.  any user
      B.   only  the superuser
      C.   There is no directory labelled  /
      D.   All of the above.

6.   Which of the following user(s) can access the /root directory?
       A.  No one can access the /root directory
       B.  Any user who knows root's password
       C.  Only root
       D.  Only the administrator.
 
7.   Where would you look to find the directories that contain
       an ordinary  user's private files?

         A.  The /home directory.
         B.   The / directory.
         C.   The   /root directory.
         D.   Ordinary users can't have private files.
         E.    None of the above

8.  In this incomplete directory chain, which of the choices is most
     likely the next item in the chain?   /etc/first/second/third/fourth/
 
        A.   A directory
        B.   A file
        C.   Either a file or a directory
        D.   None of the above, 'fourth' is the end of the chain

9.  In #8,  what is '/third', a file or a directory?

10.  True or False:  The final item of a directory chain always
        contains some kind of data.

11..  In this chain,   /bin/cats/feeding/litterbox/,   which the following best describes  /feeding

          A.  Both C and D
          B.   Neither C nor D
          C.   Parent directory
          D.   Child directory
 

12.  When should root operate under a different user name to do routine work that ordinary
users do?
 
          A.  When the administrator of the system gives the order.
          B.   When root is not doing special work that only root can do..
          C.   On Good Friday and Passover and Eid Al Adha
          D.   When it's necessary to make critical adjustments on the overall system..
          E.    None of the above

13.  Suppose that 'root' has switched to operate as an ordinary user and then has to
       make some critical changes in the system.  What should this user do?

        A.  Switch back to become  'root'
        B.   Switch to become the superuser.
        C.   Remain as an ordinary user and make the changes.
        D.   Let one of the other users do it.
        E.    Either A or B but not both.

14.   Which of these should never be deleted, added, or renamed?
 
        A.  The subdirectories of the root directory.
        B.   Any directories that you create.
        C.   Both  A and B
        D.  It's safe to delete any directory.

---------------------------------------------------------------------------------------
Answer to #3   This is a trick question.  When you log on to Linux, you must supply your user name and
password.  Other than that, anyone can access the root directory without an additional password.

----------------------------------------------------------------------------------------------------------------------
Here's a list of the various cabinet drawers that shows the general roles that their files play.
.
/bin        Essential command binaries such as certain programs.
/dev       Device files such as floppy drive, CDROM, hard drive partitions and many others
/etc        Machine-local system configuration
/home    User home directories
/lib         Shared libraries
/mnt       Mount point of devices, often used in conjunction with  /dev.
/proc      Process information pseudo-filesystem
/root      Home directory for root user, root
/sbin      Essential system binaries
/tmp       Temporary files
/usr       Second major hierarchy
/var       Variable data
 

In order to make use of the Linux directory system, we must know how to select a directory, how to look at its contents,  create new directories, copy or move  data from one directory to another, add files and many other operations.  But first, we must learn about the COMMAND LINE and then how to issue commands to do all these operations.

Reply via email to