

























































                                 - 1 -               January 4, 1980








                           INTRODUCTION TO UNIX






          uu         uu        nn       nn    iii     ttttttttt
          uu         uu        nnn      nn    iii        ttt
          uu         uu        nn n     nn    iii        ttt
          uu         uu        nn  n    nn    iii        ttt
          uu         uu        nn   n   nn    iii        ttt
          uu         uu        nn    n  nn    iii        ttt
          uuuuuuuuuuuuu        nn     nnn     iii        ttt


                              iiiiiiiiiiiiiiii
                                  iii  iii
                                  iii  iii
                                  iii  iii
                                  iii  iii
                              iiiiiiiiiiiiiiii






           (Internal Structure; Manipulating Directories and Files)












                                                 Mildred M. Ware
                                                 September, 1978



















   MP119                                        Introduction to UNIX

                     _T_A_B_L_E _O_F _C_O_N_T_E_N_T_S



                           _U_n_i_t _I_I

        A. Introduction to Unit II____________________________ 1

        B. Objectives for Unit II_____________________________ 2

        C. Module I -- Internal Structure

           Objectives for Module I ___________________________ 3
           1. Directories_____________________________________ 4
           2. Pathnames_______________________________________ 6
           3. System directories______________________________ 7
           4. Using your-neighbor's files_____________________ 9
           5. Print working directory_________________________ 10
           6. Exercises_______________________________________ 11

        D. Module II -- Manipulating directories and files

           Objectives for Module II __________________________ 12
           1. Creating directories____________________________ 13
           2. Changing directories____________________________ 14
           3. Transferring to another's directory_____________ 16
           4. Copying files___________________________________ 17
           5. Transferring files______________________________ 17
           6. The move command________________________________ 18
           7. Removing directories____________________________ 18
           8. Exercises_______________________________________ 19

        E. Unit II command summary____________________________ 20

        F. Unit II proficiency test___________________________ 21



















                                 - i -






   MP119                                        Introduction to UNIX


                      _I_n_t_r_o_d_u_c_t_i_o_n _t_o _U_n_i_t _I_I


        This unit discusses directories and directory manipulation.

        In module I, you will learn the internal structure of direc-
   tories.  Topics discussed include pathnames, forming directories,
   and determining the current working directory.

        In module II, you will learn to perform directory  manipula-
   tions.  Creating, deleting, and changing directories will be dis-
   cussed.  Copying files from one directory to another will also be
   covered.







































                                 - 1 -







   MP119                                        Introduction to UNIX


                       _O_b_j_e_c_t_i_v_e_s _f_o_r _U_n_i_t _I_I


        When you complete this unit, you will be able to:



    1.  Depict the internal structure of directories.

    2.  Define the word 'Pathname' and 'root' directory.

    3.  Reference another user's directory.

    4.  Create directories

    5.  Delete directories

    6.  Transfer from one directory to another

    7.  Copy files from other user's directories as well as from one
        of your directories to another.































                                 - 2 -
   Unit II                                                  Module I






   MP119                                        Introduction to UNIX


                      _M_o_d_u_l_e _I -- _I_n_t_e_r_n_a_l _S_t_r_u_c_t_u_r_e


        This module covers Unit II objectives 1, 2, and 3.


        _O_b_j_e_c_t_i_v_e_s


        After completion of this module the student will be able to:



    1.  Distinguish between a file and a directory

    2.  Define the word 'Pathname'

    3.  Recognize several system directories

    4.  Define 'root directory'

    5.  Construct pathnames

    6.  Reference other user's files

    7.  Determine the current working directory

    8.  Depict the internal structure of a network of directories























                                 - 3 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX


        _D_i_r_e_c_t_o_r_i_e_s


        As mentioned in unit I, you are assigned a directory by  the
   system.   This  directory  is called the "login directory" and is
   being used to hold the files you've been creating.   In  addition
   to  this  directory,  you  may  create as many other directories,
   referred to as subdirectories, as you  need.   You  are  probably
   asking  yourself,  why  do  I need other directories.  Well, sub-
   directories are used to group together files  containing  related
   information.   For  example, suppose you are secretary to several
   persons, wouldn't it be easier for you to file each person's work
   in  a  separate  drawer,  than  have  everyone's work in the same
   drawer.  This feature is used for the  same  purpose;  it  merely
   facilitates  accessing  and storing of your files.  Let's look at
   the scheme below depicting a network of directories.

                        dir  (login directory)

                       /   \

                     /       \

                   /           \

                 dir1            dir2

               /  |   \            \

             /    |     \             \

          /      |        \             \

        dir1A  dir1B        dir1C        dir2A

                  |                         |

                  |                         |

                dir1BA                    dir2B



        The names appearing in the scheme have no real significance,
   They  represent  the  names  of directories.  Directory names are
   formed in the same manner as file names --  arbitrarily  choosen,
   not to exceed 14 characters.




                                 - 4 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX

        Now, to get back to the diagram; 'dir', the login  directory
   contains  two subdirectories (dir1 and dir2) in addition to other
   files.

        If you were to list the table  of  contents  for  the  login
   directory,  the  information  displayed for the directories would
   differ only slightly from that of a file.

                       eg.  ls -l

   Results similar to this will be displayed:

                  drwxr--r-- 5  mmw   632 Feb 28 1205 dir1

                  drw-r--r-- 3  mmw 1028 Mar 2 1005 dir2


        You will notice that a "d" appears  in  the  first  position
   instead of a '-'; this indicates that this is a directory instead
   of a file.  Also, in the 11th position there is a "5" instead  of
   a "1"; this denotes the number of links or names directly associ-
   ated with this particular directory. Let's determine the 5  names
   associated  with "dir1"-- (1) the login directory name (dir), (2)
   the directory name (dir1) and (3) the  3  subdirectories;  dir1A,
   dir1B, and dir1C. when using the "ls" command to list information
   pertaining to a file, this position should be a "1".

        Now suppose you are in directory "dir1" instead of directory
   "dir" and you issue the command:

                            % ls -l

   Results similar to this will be displayed:

           drwxr--r-- 2 mmw    32 Mar  4 09:00 dir1A
           drwxr--r-- 3 mmw   824 Mar  1 11:00 dir1B
           drwxr--r-- 2 mmw  1026 Feb  2 08:00 dir1C

   Main points to remember:

    1.  Directories may contain files and other directories

    2.  Directories are named in the same manner as files

    3.  All users have a login directory







                                 - 5 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX

   Note: Your current directory which in this  case  is  your  login
         directory can be referenced by a period (.); therefore, the
         above list command can be formed as  "%ls -l  .".   Notice,
         the  period  follows  the -l option.  It is used to replace
         the directory name.

        _P_a_t_h_n_a_m_e_s


        I know that your next question will probably be, how  can  I
   get from my login directory to one of my subdirectories.

        Well, first try to  visualize  the  network  of  directories
   diagram.   Okay,  now relate it to a tree, where the login direc-
   tory is the trunk of the tree  and  the  subdirectories  are  the
   branches.   Let's go a step further, how would you get to the top
   of the tree from the ground?  Right,  you  would  begin  climbing
   first  to  one  branch then to another, in other words, you would
   follow some path until you reached your destination.

        You are going to take the same approach here  by  tracing  a
   path  from  the  login  directory to the desired directory.  This
   path is established by forming a list of all the directories  you
   encounter on the way; separate each by a slash.

        The period (.) shall be used to refer to your  login  direc-
   tory ,since we haven't discussed how to explicitly reference it.

   Example:  Your goal is to be in directory "dir1ba"  ;  thus,  the
   pathname would be: "./dir1/dir1b/dir1ba"

        Consequently, a pathname represents the  full  name  of  the
   path you have to follow through the tree of directories to get to
   a particular directory or  file;  also  in  any  command  that  a
   filename  or  directory  name may be specified, a pathname may be
   specified.

                Example:  % ls ./dir1/dir1b/dir1ba

   What do you think will be displayed from the above? Come on, take
   a guess.


   Right you are, this would list the names  of  all  the  files  in
   "dir1ba".  See how much confidence I have in you.

   Note: The filename/filenames may be replaced by  the  appropriate
         pathname/pathnames in all of the commands discussed in Unit
         I.



                                 - 6 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX

        _S_y_s_t_e_m _d_i_r_e_c_t_o_r_i_e_s


        Now for a look at the internal structure of the Unix  system
   in  its  entirety.   The system is composed of system directories
   and user directories.  In the last section you saw a hypothetical
   example of one user's directory which represented only one branch
   on our large tree.  The diagram below represents a more  complete
   picture of the Unix system.

                                     / (this slash, represents the
                                                  root directory)
                                  /  |   \

                                /    |       \

            etc     bin    lib       u?        usr    tmp     dev

            / \      /\    /\   /  |  \      /\   /\      /\

                                /     |     \

                             /      robin      \

                         pam        /   |        angie

                                 /      |          |

                             dir1      dir2        |

                          /   |   \     |        dir3

                      dir1a dir1b dir1c  dir2a
                              |           |

                              |           |

                           dir1ba       dir2b


        The "Root" directory  is  the  "parent"  directory  for  the
   entire  system and contains the system directories: etc, bin, u?,
   usr, lib,tmp, and dev.  These directories consist  of  executable
   files  that maintain the system, such as: keeping a record of all
   persons using the system, keeping a record  of  all  valid  pass-
   words,  storing and accessing commands when referenced, and other
   similar functions.   Don't  concern  yourself  about  remembering
   these  directories; the purpose of mentioning them is to give you
   a complete picture of the system.



                                 - 7 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX

        However, there is one category of  directories  on  which  I
   want  you  to  focus your attention, u?.  These directories holds
   all the valid login names for the system.  The "?"  is  a  number
   1-8;  the  number  assigned  to you and some other users might be
   "3".  Hence, to reference your  login  directory,  you  begin  by
   specifying:  root(/),  then  the directory which holds your login
   name (u3), a slash, and your login name.

                       Example:  /u3/mmw

        There are two types of pathnames which may be formed; a full
   pathname,  and  simple  pathname.   A  full pathname is formed by
   beginning with the "root" directory; whereas, a  simple  pathname
   is  formed  by  beginning  with  the  current directory name (the
   directory you are currently in).  This will be further  discussed
   in the section on "changing directories".

        Let's refer back to the diagram and assume  your  login-name
   is  robin  and  you want to display a file "junk" from your login
   directory; form the command using the full  pathname  instead  of
   just the filename.


   Is your answer one of the following:

                       % cat /u3/robin/junk
                       % pr /u3/robin/junk

        Pat yourself on the back if it is, you deserve it; otherwise
   please  reread  this section until you have a clear understanding
   of this concept.

        Okay, now form the command to display the file "junk1"  from
   the directory "dir1b".

        You had to climb a couple of branches in our tree to get  to
   "dir1b"  didn't  you? Did you indicate this in forming your path-
   name? If you did, you should have:

                  % cat /u3/robin/dir1/dir1b/junk

   Give yourself a couple of pats if you got this correct.

   Note: Remember to always begin with the login or  current  direc-
         tory,  list all subdirectories along the path, and end with
         the filename when referring to a particular file.  Got it?

   Lets do one more, what would be the results of the following:

                     % ls /u3/robin/dir2/dir2a


                                 - 8 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX

   Write your answer in the space provided:


   You are correct, if your answer is:  A list of all  filenames  in
   "dir2a" will be displayed.  You may proceed to the next section.

        _U_s_i_n_g _y_o_u_r-_n_e_i_g_h_b_o_r'_s _f_i_l_e_s


        The ability to use pathnames affords you a tremendous amount
   of  flexibility.   You  are  no longer confined to using only the
   files created by you -- you can now reference  files  created  by
   other users.  All you have to know is the other users login-name.

        This feature can be extremely beneficial if several  persons
   are  working  on  the same project.  It can also be used to avoid
   the duplicating of efforts -- someone may  already  have  a  file
   containing  the  information you need, so why bother to create an
   identical file.

        Let's again refer to the previous diagram  and  assume  that
   you  are  'robin'.  Suppose 'pam' had a file 'letters' containing
   information on how to format a business letter and you  wanted  a
   copy  of  it.   You can get it by using one of the following com-
   mands:

                       % cat /u3/pam/letters|opr
                       % opr /u3/pam/letters
                       % pr /u3/pam/letters

   Can you think of another variation? Sure you  can  --  you  could
   pipe the results from the last command to the printer.

        Now suppose you want to determine which files are stored  in
   angie's 'dir3' directory, what would you do?



   You're on the ball today -- that's just what you would  do.   You
   would form the command:

                       % ls /u3/angie/dir3
                               or
                       % ls -l /u3/angie/dir3








                                 - 9 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX


        _P_r_i_n_t _w_o_r_k_i_n_g _d_i_r_e_c_t_o_r_y


        This feature is used to determine which  directory  you  are
   currently  using,  that  is,  in which directory are you creating
   files, or displaying files, etc.  I realize this  probably  seems
   quite  vague to you, since you are only using one directory, your
   login directory.  However, in the next module you will learn  how
   to  transfer  from  your login directory to one of your subdirec-
   tories, and from  one subdirectory to another subdirectory.  Then
   you will really appreciate this command.

        But, for now, it will give you a  clearer  understanding  of
   pathnames and directories.  The command is:

                            % pwd


        This will cause the system to display the pathname  of  your
   current or working directory.  What should you see displayed when
   you issue the above command?


   If you said; /u3/your login-name, you are doing fine.  Otherwise,
   re-read the section on System directories.

        _H_o_w _T_o _F_i_n_d _O_u_t _W_h_o_s_e _D_i_r_e_c_t_o_r_i_e_s _A_r_e _W_h_e_r_e


        Suppose you just tried to list the files of the systems guru
   whose  login name is "dlm", by typing : ls /u3/dlm, and you get a
   response that the directory does not exist.   What  then?   Well,
   this  simply  means that the person's files aren't located on the
   "u3" directory.  So, just where are the person's files?

        Hint: The system maintains a list of  all  users  and  where
   their  login  directories  can  be  found.   The pathname used to
   reference this list is "/etc/passwd".

        What will "%grep dlm /ect/passwd" give you?


   Answer: Why the login directory name  for  dlm  of  course.   The
   "grep"  command  searches the login directory list for the login-
   name dlm.  The directory name is  the  last  entry  on  the  line
   displayed  by  the  system,  and  is  delimited  by  colons.  eg.
   :/usr/dlm:

   Remember to use "grep" when you want to determine someone's login
   directory.

                                - 10 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX


        _E_x_e_r_c_i_s_e_s



    1.  Issue the "pwd" command.

    2.  Issue the command: % ls /u3/<your login name>.

    3.  Display a file  using  its  pathname  instead  of  just  its
        filename.

    4.  Determine the login directory pathname for "mmw".







































                                - 11 -
   Unit II                                                  Module I







   MP119                                        Introduction to UNIX


                    _M_o_d_u_l_e  _I_I----_D_i_r_e_c_t_o_r_y _m_a_n_i_p_u_l_a_t_i_o_n


        This module covers unit II objectives 4,5,6, and 7.

        _O_b_j_e_c_t_i_v_e_s


        Upon completion of this module, the student will be able to:



    1.  Create directories

    2.  Transfer from one directory to another

    3.  Delete directories

    4.  Transfer files from one directory to another

    5.  Copy files from other user's directories to his own






























                                - 12 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX


        _C_r_e_a_t_i_n_g _D_i_r_e_c_t_o_r_i_e_s


        In the last section it was established that you could create
   subdirectories to group related files.  This is done by using the
   following command:

                       % mkdir <name>

        Where "mkdir"  stands for "make directory",  and  "name"  is
   the  name  assigned  to the directory.  Suppose you were assigned
   the task of placing this course on the system.  Wouldn't it  sim-
   plify  matters  later  if  it were placed on the system such that
   each unit is placed in a separate directory.  This would  obviate
   the  need  to  make  up new filenames for the modules within each
   unit.

                  Example: % mkdir UnitI

        This would create a directory called unitI.  You would  then
   place  the  4 modules for unit I in this directory.  You would do
   the same for each of the other units, for example:

                       % mkdir unitII

                       % mkdir unitIII, etc.

        All of the above directories will be placed or contained  in
   your  login  directory, which in this context is also referred to
   as a "parent" directory.  A "parent" directory is  any  directory
   which  contains  at  least  one other directory.  The directories
   created above can be depicted as follows:

                                /u3/ <your login-name>

                                / | \

                              /   |    \

                           /      |       \

              UnitI    UnitII   UnitIII   UnitIV   UnitV









                                - 13 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX

   Got the idea? Then, do the following exercises.

        _E_x_e_r_c_i_s_e_s



    1.  Make two subdirectories, name them UnitI and UnitII.

    2.  Issue the command "ls -l"

    3.  There should have been two directories in your login  direc-
        tory to start. What are their names?

        _C_h_a_n_g_i_n_g _D_i_r_e_c_t_o_r_i_e_s


        Okay, you have created two empty directories, that is,  they
   contain  no files. Therefore, the next thing you want to do is to
   remedy this situation  by  placing  some  files  into  the  newly
   created directories.

        Before you can create any files  in  either  of  the  direc-
   tories, UnitI or UnitII, you must transfer from your login direc-
   tory to that directory.  The command to use is:

                       %chdir <name>

        Where "chdir" stands for change directory, and "name" is the
   name of the directory you want to transfer to.

                  Example:   % chdir UnitI

        UnitI is now the current directory.  You can begin  creating
   files,  or  using  any  of  the  commands you used in your parent
   directory.

             Example:  % cat > module1
                       <type information contained in module1>
                       <ctrl-d>

        Will create the file, module1, in UnitI.  Now, let's  create
   a  directory in UnitI and call it UnitIa.  What command would you
   use?


   % mkdir UnitIa, is correct.






                                - 14 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX

   Our internal structure now looks like this*
                      /u3/<your login-name>
                      /  |  \

                   /     |    \

                 /       |       \

     UnitI  UnitII   UnitIII    UnitIV    UnitV

       |

       |

     UnitIa

        Got the picture, see how easily you can build  your  network
   of directories.  Now, suppose you want to transfer to UnitII, how
   can this be done?  Well, one way is to issue the command:

                  % chdir /u3/<your login-name>/UnitII

        You are probably wondering  why  your  login  directory  was
   specified  here,  and it wasn't specified when you transferred to
   UnitI.  The answer is quite simple; a pathname isn't required  if
   the  directory  referenced  is  directly contained or was created
   within the current directory.

        Would a pathname be required to reference directory "UnitIa"
   from your login directory?

        Yes, of course, UnitIa is directly contained  within  UnitI,
   not your login directory, therefore a pathname is required.

        Another way to transfer from UnitI to UnitII is to  transfer
   to your login directory first, eg.

                       % chdir /u3/<your login-name>
                       % chdir UnitII

   You could have omitted the pathname; thus specifying only:

                       % chdir









                                - 15 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX


        The system will transfer you to your login directory when  a
   directory name isn't specified. Now, suppose you are in directory
   "unit1a" and you wish to return to UnitI, what command would  you
   use?

                  % chdir /u3/<your login-name>/UnitI

   You're correct if your answer  matches  the  above  command.  You
   could  have  also  used:  %chdir  ..  ;  if you specify ".." (two
   periods) instead of the directory name, the system will  transfer
   you  to  the directory in which the current directory is directly
   contained, ie. the parent directory for  the  directory  you  are
   currently in.

   Note: chdir may be abbreviated as cd.

        _T_r_a_n_s_f_e_r_r_r_i_n_g _t_o _a_n_o_t_h_e_r'_s _d_i_r_e_c_t_o_r_y


        You may also transfer to another user's directory  by  using
   the  "chdir"  command.  This feature doesn't offer any additional
   privileges; however, it is recommended if  you  have  a  need  to
   reference another user's directory several times in a session. Of
   course, the other user must have given you permission to work  in
   his  directory.  This  is  normally only done for memebers of the
   same group.

        For instance, assume  you  wish  to  list  the  file  names,
   display  a  couple  of files, and print a couple of files in user
   abc's login directory.  There are a couple of  ways  you  can  do
   this.  One is by using pathnames to reference abc's directory:

                       % ls -l /u3/abc
                       % cat /u3/abc/file1
                       % cat /u3/abc/file2
                       % opr /u3/abc/file1
                       % opr /u3/abc/file2
   The other is to transfer to abc's directory:

                       % chdir /u3/abc
                       % ls -l
                       % cat file1
                       % cat file2
                       % opr file1
                       % opr file2






                                - 16 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX

   NOTE:(1) The latter approach doesn't bog you down with the  tedi-
            ousness  of  repeatedly  specifying  the  pathname. This
            would be even more effective if the referenced directory
            is more deeply nested (farther up in the Unix tree).
        (2) If you try to transfer to someone else's  directory  and
            you  receive  the  response:  bad directory.  This means
            that there is no such directory or that  the  owner  has
            denied you permission to use the directory.

        _C_o_p_y_i_n_g _f_i_l_e_s


        While browsing through your neighbor's  directory,  you  may
   see  a file that you would like to have in your directory.  Well,
   why not copy it; you can by using the "cp" (copy) command.  First
   transfer  to your directory, whichever directory you want to hold
   the copied file, then issue this command.

                       % cp <pathname> <filename>

        Where "pathname" is the pathname of the file to  be  copied,
   and  "filename"  is the name of the file to hold the copied file.
   For example, suppse you wish to copy "file1"  from  abc's  direc-
   tory, then you would issue:

                       % cp /u3/abc/file1 file2

   abc's file1 is now your file2.  "file1" remains unchanged.

        _T_r_a_n_s_f_e_r_r_i_n_g _f_i_l_e_s


        You may also copy or transfer your files from one  directory
   to another directory by using the copy command. Assume there is a
   file "junk" in your login directory, and you would like  to  have
   it  in  your UnitI directory.  To accomplish this task, you would
   issue the following sequence of commands:

                  % cd UnitI
                  % cp /u3/<your login-name>/junk junk
                  % rm /u3/<your login-name>/junk

   This would copy the file "junk" from your  login  directory  into
   the  directory, UnitI, and delete the file "junk" from your login
   directory.

        Now something for you to do. Copy the file "junk"  from  the





                                - 17 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX

   directory "UnitIa" to your login directory. You are in UnitIa.


   If your answer is the following, you deserve an A+.

             % cd ..  or   %cd /u3/<your login-name>
             % cp /u3/<your login-name>/UnitI/UnitIa/junk  junk

        The file "junk" now resides in both directories, UnitIa  and
   your  parent  directory.  This exercise also illustrates that the
   same filename may exist in more than one directory.

   NOTE: In order to copy  a  file,  you  must  be  given  the  read
         privilege for that file.

        _T_h_e _M_o_v_e _c_o_m_m_a_n_d


        The Move command can also be used to transfer files  between
   your  directories.  It is very similar to the "cp" command except
   that the file being copied is deleted  from  its  directory.  The
   form of the command is:

                     % mv <pathname> <filename>

        Where "pathname" and "filename" have  their  previous  mean-
   ings.   Use  of  this command would eliminate the need to use the
   "rm" command as in the previous example.

        _R_e_m_o_v_i_n_g _d_i_r_e_c_t_o_r_i_e_s


        If you have deleted all the files from a directory, the next
   step is to delete the directory also.  The command to use is :

                     % rmdir <directory-name>

        This command is issued in the directory in which the  direc-
   tory  to  be deleted is directly contained, ie. the parent direc-
   tory of the directory to be deleted.

        In which directory would the above command be issued if  you
   wished  to  delete the directory "UnitIa" from our previous exam-
   ple?


   Right you are--you would issue the command, "% rmdir UnitIa",  in
   directory "UnitI".

   Note: A directory must be empty before it can be deleted.


                                - 18 -
   Unit II                                                 Module II







   MP119                                        Introduction to UNIX


        _E_x_e_r_c_i_s_e_s



    1.  Transfer to the previously created  directory  "unitI",  and
        create a file named "junk".  It doesn't matter what you type
        in the file.

    2.  Copy the newly created file "junk" from UnitI and  place  it
        in "UnitII" such that it exist in both directories.

    3.  Copy the file "junk" from "UnitII", place it in your " login
        directory" and remove it from "UnitII".

    4.  Create the directory "U1a" in "UnitI";  issue  the  "ls  -l"
        command, and return to your login directory.

    5.  Copy the file "junk" from "UnitI" and place it in "U1a".

    6.  Delete the directory "UnitII".

   ****If you are unable to perform these exercises,  please  review
       this  module or contact your instructor before attempting the
       Unit II proficiency test.



























                                - 19 -
   Unit II                                           Commands & Test







   MP119                                        Introduction to UNIX


                     _U_n_i_t _I_I _C_o_m_m_a_n_d _S_u_m_m_a_r_y



    1.  pwd (print working directory)

    2.  mkdir <directory name> ...

    3.  chdir <directory name>

    4.  rmdir <directory name> ...

    5.  cp <pathname> <filename>

    6.  mv <pathname> <filename>


   Note: <directory name> ... indicates that more than one directory
         name may be specified in that command.




        You are moving right along, here you are about to  take  the
   test  for  Unit  II.  You have 30 minutes to complete the Unit II
   proficiency test; and may use the Unit II command  summary  sheet
   as a reference.
























                                - 20 -
   Unit II                                           Commands & Test







   MP119                                        Introduction to UNIX


                      _U_n_i_t _I_I _P_r_o_f_i_c_i_e_n_c_y _T_e_s_t

   Use the following network of directories to answer these
   questions.

                          /u3/A
                            /  \
                          /     \
                         B        C
                       / |         \
                     /   |          \
                    D    E            F
                         |
                         |
                         G
                         |
                         |
                         H



    1.  The login directory is _________________.

    2.  The   pathname   used   to    referenced    directory    "D"
        is__________________.

    3.  Write the command to list the filenames  in  directory  "F";
        the    current    directory    is    the    "login    direc-
        tory"._______________________.

    4.  Write the command to display the file  "junk"  in  directory
        "G"; the current directory is "E". _______________________.

    5.  The   command   used    to    create    a    directory    is
        ___________________.

    6.  The command used to transfer from one directory  to  another
        is ______.

    7.  The    command    used    to    delete    directories     is
        __________________________.

    8.  Can you reference another user's files without  transferring
        to  that  user's directory?_________.  If yes, state the the
        advantage, if there  is  one,  in  transferring  to  another
        user's directory?
        ___________________________________________________________.

    9.  The ____________ and _____________ commands are used to copy
        files from one directory to another.

                                - 21 -
   Unit II                                           Commands & Test







   MP119                                        Introduction to UNIX

   10.  When would you use the "mv" command instead of the "cp" com-
        mand to copy a file? _________________________________.

   11.  The current directory is "H"; what would be displayed if the
        command, % pwd , is issued? _______________________________

   12.  Write a command to copy the file "junk" from directory  "F";
        your current directory  is "E".___________________________.

   13.  Write a command to transfer from directory "H" to  directory
        "E".  _______________________________.

   ****Please contact your instructor to have your  paper  corrected
       before continuing to Unit III.






































                                - 22 -
   Unit II                                           Commands & Test







   MP119                                        Introduction to UNIX


                      _U_n_i_t _I_I _C_r_i_t_i_q_u_e _S_h_e_e_t

   Please, gives us just a few minutes of  your  time  and  complete
   this critique sheet.

    1.  It took me approximately  ---------------- hours to complete
        this unit.

    2.  How much experience  did  you  have  before  beginning  this
        course?
            a.  plenty
            b.  some, but not much
            c.  none

    3.  Was the material difficult?
            a.  hard
            b.  hard, but not impossible
            c.  about right
            d.  easy
            e.  too easy

    4.  How did you like it?
            a.  It was fun
            b.  It was somewhat enjoyable
            c.  It was tolerable
            d.  It was boring

    5.  What did you think of  each  module;  was  the  presentation
        confusing?

        ModuleI _________
        where ________________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________

        Module II ____________
        where ________________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________

    6.  Do any sections require more explanation?
        yes________        no__________
        If yes, please help by listing them.
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________


                                - 23 -
   Unit II                                           Commands & Test







   MP119                                        Introduction to UNIX

    7.  Were any topics too wordy? ___________
        (please list them)
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________

    8.  Were the objectives clearly stated?___________
        (Please let us know which ones that aren't)
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________

    9.  Did the material cover the objectives? ________________
        (again we are soliciting  your  help;  tell  us  which  ones
        weren't covered)
        ______________________________________________________
        ______________________________________________________

   10.  What did you think of the exercises?
            a.  too many
            b.  right amount
            c.  not enough

   11.  How well do yo think the test evaluated the subject matter?
            a.  completely
            b.  adequately
            c.  poorly

   12.  Please list any further comments or suggestions which would help
        to improve this unit.
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________
   ****Please return this to your instructor; you  do  not  have  to
       sign it.




   THANK YOU FOR YOUR HELP.










                                - 24 -
   Unit II                                           Commands & Test




