


   MP119                                        Introduction to Unix





















































                                 - 1 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix


             Unix Final Exam

   Name:_________________________Date:_________________



    1.  To halt execution of a command, depress the ___________key.

    2.  The "#" and the "@" are used for __________________________.

    3.  Write the command which could be used to remind  you   of  a
        meeting scheduled for 12 O'clock noon, three days from now.




    4.  Write the command to copy three files, j1, j2, and j3 into a
        file called "save".




    5.  Write the command to append the file junk to the file junk2.

    6.  Contrast the following commands:
            a.   cat junk



            b.   pr junk



            c.   opr junk




    7.  Write the command used to delete all files from your  direc-
        tory which begin with one of the letters: a, b, or c.




    8.  Write the command to change the mode of a file  named  junk,
        such  that  only  the  owner  has  read,  write, and execute
        priviledges.




                                 - 2 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

    9.  You have a file named junk which  contains  3,000  lines  of
        text.   Write the necessary commands to obtain a paper list-
        ing of the file.







   10.  Write the command to obtain a paper listing of all lines  of
        text in the file junk, not ending in a period.  The printout
        is to be in ascending order.




   11.  Write the command to determine the number of lines  of  text
        in junk that begin with an "a".




        Use the following network of directories to answer questions
        12-19:

                                 /u3/A

                                 /  \

                               /      \

                             B         C

                            /        /   \

                          /         /      \

                         D        C1           F

                       /  \

                      /     \

                     D1      D2


   12.  The    parent    directory    of    directory     "D"     is
        ________________________.



                                 - 3 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

   13.  The current directory is "D2"; what will be displayed if the
        command, %pwd, is issued? _____________________.

   14.  The current directory is "B"; write the  command  you  would
        use to transfer to directory "D2" ____________________.

   15.  The current directory is "D1"; write the command to copy and
        delete the file, junk, from directory "F". ________________.

   16.  The current directory is "C1";  write the command to  obtain
        a  paper  listing  of  the  file  "temp" which is located in
        directory "F". ____________________.

   17.  The current directory is "D1"; write the command to list the
        filenames in the login directory. _______________________.

   18.  The current directory is  the  login  directory;  write  the
        necessary commands to create a directory "F1" which is to be
        a subdirectory of directory "F".  _________________.

   19.  The current directory is "B"; write the command/commands  to
        delete directory "D1". ___________________.

        Assume that you are using the Unix Text editor, and the fol-
        lowing file,"success", to answer questions 20-28.

        _s_u_c_c_e_s_s:

        A typical unix installation
        provides simultaneous
        service at keyboard
        terminals to from 10 to 40 users.
        Such installations have
        rapidly become popular
        because the unix system provides
        provides a software base for writing
        programs to handle a great variety
        of software applications.

                         Write commands to:


   20.  Change the word unix to UNIX throughout the file and display
        the corrected lines.



   21.  Delete the second occurrence of software.




                                 - 4 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

   22.  Insert the clause, "  who  may  be  carrying  out  different
        tasks.", following "users,".




   23.  Append the following sentence to the end of the file:

        "Furthermore, the UNIX system includes very effective  tools
        for writing software.".



   24.  Append the following sentence to the beginning of the file:

        The Unix family has greatly increased the flexibility of the
        operating system.".




   25.  Create a file called "part" consisting of lines 6  -  10  of
        success.




   26.  Delete the last 3 lines of success.



   27.  The current file is "part"; modify the file, "success", such
        that a dollar sign is placed at the end of each line.




   28.  The current file is "success"; prepend the file, "part",  to
        it.


        Assume the you are using nroff and the nm macro package  for
        the following questions.


   29.  Write the command to obtain a paper listing of  pages  10-40
        of a file named, misile.





                                 - 5 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

   30.  Write the commands to define and execute a character string,
        CS, which contains the phrase "DELETE NEXT LINE".




   31.  Write the commands to define and execute a macro, FM,  which
        displays a title containing the current date and page number
        in lower-case Roman numerals at the top of each page.




   32.  Make a simple display showing what will be produced  by  the
        following series of commands:

                  .P1 Book~I
                  <text>
                  .P2 Chapter~1
                  <text>
                  .P2 Chapter~2
                  <text>
                  .P1 Book~II
                  <text>
                  .TC






   33.  Write the commands and format the following text  such  that
        the  fields  begin  in  print  positions  1, 15, 30, and 45,
        respectively.

        John, Doefield      226-50-0422     E21     GS11



   34.  Write the commands to define and execute a macro, re,  which
        displays the retention date for certain blocks of text, eg.

                       RETENTION DATE:  12-22-78

        TO DO: 1. Use arguments to pass the date to the macro.
               2. Center the above line.
               3. Leave 5 blank lines following the above line.





                                 - 6 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

   35.  Write  the  necessary  commands  to  format  a   file   that
        suppresses  the  page  number and displays "CONFIDENTIAL" at
        the top and bottom of each page.




   36.  Write the command to number paragraphs in a file using   the
        Arabic notation.




   37.  Analyze the following commands:
            a.  .ul 5
            b.  .E1
            c.  .PP 8
            d.  .ti 10
            e.  .ti +10




   38.  What will be displayed by the following:

        MP119 is an introductory course on
        .I Unix
        for the novice.
























                                 - 7 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

   39.  Show how the file would appear to produce the following:

        _I. "_U_n_i_x _c_o_m_m_a_n_d_s"
             A. Inter-user Communication
                (1) write
                (2) msg
                (3) sndmsg
             B. Utility
                (1) who
                (2) where
                (3) news
















   40.  What will be displayed by the following:

        .PH "" 0 2 0 0 1
        <text>
        .PH
        <text>
        .PH
        <text>

   Assume that you are using the RAND editor for the following ques-
   tions:





   41.  Analyze the following command:

                       editor +junk 20 5






                                 - 8 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

   42.  What would you type to scroll the file back 50 lines?




   43.  What will be the result of typing the  following?

                  <BREAK>
                  150
                  <GO TO>




   44.  What is the purpose of the alternate buffer (also called the
        close and delete buffer); and how may its contents be refer-
        enced?




   45.  Which function keys are used to  reposition  text  within  a
        file?




   46.  The cursor is positioned at the beginning of the file;  what
        would  you type to locate the word, "text", which is located
        near the end of the file?




   47.  What would you type to delete the first 10  lines  from  the
        current file?




   48.  What is the purpose of using MAKE PORT ?

   49.  You are viewing 5 files simultaneously; the 4th file is  the
        current  file.  What would you type to make the 2nd file the
        current file?



   50.  You are editing a file named "junk"; what would you type  to
        copy the first 10 lines from "junk" to "temp"?


                                 - 9 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix





















































                                - 10 -
   Final Exam                                   Answer on this Sheet







   MP119                                        Introduction to Unix

                       COURSE MANAGEMENT MANUAL
                                MP-119
                         INTRODUCTION TO UNIX



        _C_o_u_r_s_e _O_r_g_a_n_i_z_a_t_i_o_n:


        The course is self-paced and designed  to  be  taken  either
   individually or in a group environment.

        The following four student manuals (Units  I-IV)  constitute
   the entire  learning package:


         UNIT I  -  Gaining access to Unix;Inter-User Communication;
                    File Manipulation and Utility Programs


         UNIT II -  Internal Structure; Manipulatory Directories


         UNIT III - UNIX Text Editor; nroff; Text Formatting


         UNIT IV -  The RAND Editor

        _P_r_o_g_r_e_s_s _C_h_e_c_k_s:


        The student takes a Proficiency Test at  the  conclusion  of
   each  of the four UNITS of instruction. The Answer Keys for these
   Proficiency Tests are attched. A referral to the section  of  the
   text  where  the relevant issue is discussed is provided for each
   answer. The tests themselves are to be self-  graded  to  measure
   the student's retention and comprehension of the subject matter.

        Unit I  -  21 fill-in the blank questions/answers

        Unit II -  10 fill-in the blank questions/answers

        Unit III - 25 fill-in the blank questions/answers

        Unit IV -  20 fill-in the blank questions/answers

        In the answer keys which follow you will find a refernce  to
   the  section  in  which  the answer is found as well as the exact
   page number.  The is intended to be of use to the course  manager



                                 - 1 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   in aiding students who are experiencing problems.

        _F_I_N_A_L _E_X_A_M_I_N_A_T_I_O_N:


        The final examination consists of 50 fill-in the blank  type
   questions.  It shall be administered by the Learning Center Moni-
   tor. The Final Exam Answer Key is attached. A score  of  70%  (35
   correct  out  of  50  responses) is required to receive a passing
   grade in this PASS/FAIL course.

        _A_S_S_I_S_T_A_N_C_E _A_N_D _Q_U_E_S_T_I_O_N_S:


        Questions and  comments  should  be  directed  to  Mr.  John
   Cashour, E22 Software Design and Development on 8955(s).

        _A_d_d_i_t_i_o_n_a_l _S_o_u_r_c_e_s


        The material which is presented in MP119 is only an overview
   of  the  facilities that are currently available on the UNIX sys-
   tem. For information concerning the more esoteric and less widely
   used  aspects  of the system, one must consult the various manual
   sources.

        On the topic of the UNIX Editor, two sources  are  currently
   available:  "A Tutorial Introduction to the UNIX Text Editor" and
   "Advanced Editing on UNIX." Both are included  in  _D_o_c_u_m_e_n_t_s  _f_o_r
   _t_h_e  _P_W_B/_U_N_I_X  _T_i_m_e  _S_h_a_r_i_n_g _S_y_s_t_e_m (sections B.3 and B.4 respec-
   tively).

        For additional information on NROFF and the NM macro package
   consult  the  following  sources: "NROFF/TROFF User's Manual," "A
   TROFF Tutorial," "MNM-Macros for Formatting  Informal  Documents"
   and   "User's   Guide   to   the  'NM'  Macros"(PIB-78-006).  The
   NROFF/TROFF items can be found in the _D_o_c_u_m_e_n_t_s.   The  first  of
   the  macro  items  mentioned  above  forms a part of the _P_W_B/_U_N_I_X
   _U_s_e_r'_s _M_a_n_u_a_l (Supplement, section 7, MNM [VII], pp.  1-6).   The
   "User's  Guide" is on line, a copy can be obtained from your UNIX
   system administrator. One more item of interest concerning  NROFF
   is  the  relevant  section  in the _P_W_B/_U_N_I_X _U_s_e_r'_s _M_a_n_u_a_l (listed
   alphabetically in section 1 - PWB/UNIX  I).   Finally,  for  more
   information  on  the  Rand Editor consult the following: "The CRT
   Text Editor NED - Introduction and Reference Manual."

        A few comments on the organization of  the  _P_W_B/_U_N_I_X  _U_s_e_r'_s
   _M_a_n_u_a_l  would  appear  to  be  in  order.  The "User's Manual" is
   divided into the following eight sections:



                                 - 2 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

              I.  Commands and Application Programs

             II.  System Calls

            III.  Subroutines

             IV.  Special Files

              V.  File Formats and Conventions

             VI.  Games

            VII.  Miscellaneous

           VIII.  System Maintenance

   Each of these sections consists of a number of entries of several
   pages in length. Within each section entries are organized alpha-
   betically according to entry name, which  appears  in  the  upper
   right-hand corner.  Supplements to the manual are integrated into
   the proper section.

        All of the materials discussed above  should  be  obtainable
   from  your  system administrator. If not, DOD-FT. Meade users are
   advised to contact Mr. Joseph Clemmons.

        If you have a UNIX question and none of  the  above  sources
   can provide an adequate answer, it's time for you to consult your
   local UNIX guru.























                                 - 3 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX


        _A_n_s_w_e_r_s _t_o _U_n_i_t _I _P_r_o_f_i_c_i_e_n_c_y _T_e_s_t



    1.  Information is sent to the computer one line at a time. (See
        the explanation of the return key under "The Keyboard.")

    2.  To halt execution of a command, depress the _R_U_B_O_U_T key. (See
        the explanation of the rubout key under "The Keyboard.")

    3.  Corrections are made to an input line before the  RETURN key
        is  depressed.  (See the explanation of the return key under
        "The Keyboard.")

    4.  The command to change your password is :  %_p_a_s_s_w_d  (See  the
        example under "Changing Passwords.")

    5.  The _m_s_g program is used to read a message that has been sent
        to you.  (See the explanation of the command given in "Read-
        ing your Mail.")

    6.  _s_n_d_m_s_g is the command used to send messages to other  users.
        (See  the  explanation of the command given in "Sending Mes-
        sages.")

    7.  The _w_r_i_t_e command can be used to conduct a two-way conversa-
        tion.  (See  the  explanation  of the procedure under "Write
        Command.")

    8.  remind mmw +3:00 -r"you have a meeting"
        ---------------------------------------
        (See the section entitled "Write Command.")

    9.  _c_a_t command is used to create a file, display  a  file,  and
        append  one file to another file. (See the sections entitled
        "Creating Files,"  "Copying  Files,"  "Cat  Command,"  "Con-
        catenating Files," and "Appending Information.")

   10.  The command, %_c_a_t _j_1 >> _j_2 will append j1 to  j2.  (See  the
        example in the section entitled "Appending Information.")

   11.  _p_r _j_u_n_k|_o_p_r will print the file junk  on  the  line  printer
        with  header lines.  (See the section entitled "The Opr Com-
        mand as a Filter.")

   12.  _p_r -_t _j_1 _j_2 | _o_p_r or _c_a_t _j_1 _j_2 | _o_p_r will print the files j1
        and  j2  without  header  lines.  (For an explanation of the
        first alternative see the description of the -t option under
        "The  Print  Command."   Use  of  the  second alternative is
        described in the section entitled "Concatenating Files>")

                                 - 4 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   13.  _r_m [_a-_h]?  will delete all files beginning in  a-h  followed
        by any single character. (See the consideration of the ? and
        [...] wildcards in "Filenames and Wildcards" and the discus-
        sion  of  the  rm  command in the section entitled "Deleting
        Several Files.")

   14.  _l_s -_r *_b_a_k will display all files ending in  "bak"  in  des-
        cending  order.   (See  the  discussion of the * wildcard in
        "Filenames and Wildcards" and the explanation of the ls com-
        mand in the section entitled "Listing Filenames.")

   15.  The _c_m_p _a_n_d _d_i_f_f commands are used to  compare  files.  (See
        the  explanation  of these two commands in the section enti-
        tled "Comparing Files.")

   16.  The command %_c_h_m_o_d _7_0 _j_u_n_k will give read, write,  and  exe-
        cute  priviledges  to the owner's group, and will remove all
        priviledges for all other users of the file. (See the expla-
        nation  of  the chmod command in the section entitled "Chmod
        Command.")

   17.  %_g_r_e_p -_c -_v '_\.$' _j_u_n_k will display the number of  lines  in
        the file, junk, not ending in a period. (See the explanation
        of the grep command, its options and the use of  expressions
        with the command in the sections entitled "Searching a File"
        and "Expressions.")

   18.  %_s_o_r_t -_t/ -_r -_n +_3 _j_u_n_k|_o_p_r will sort by fields in  descend-
        ing  order and route to the printer.  A numeric sort is per-
        formed on the 4th field; and the '/' is the field delimiter.
        (See  the explanation of the sort command and its options in
        the sections entitled "Sorting Files" and "Sort Options.")

   19.  %_s_o_r_t -_a _j_u_n_k|_p_r -_h _s_e_c_r_e_t  will  sort  the  upper-case  and
        lower-case  letters  separately.  The  output will contain a
        header with  the  classification  'secret'  instead  of  the
        filename.  (The  portion  of  the command to the left of the
        pipe is described in the section  entitled  "Sort  Options."
        The  other part of the command (to the right of the pipe) is
        described in the section entitled "The Print Command.")

   20.  %_s_p_l_i_t -_1_0_0_0 _j_u_n_k will segment junk  into  files  containing
        1000  lines  each;  the  files will be named: xaa, xab, xac,
        etc. depending on the size of junk.  (See the section  enti-
        tled "Segmenting a File" for an explanation of how the split
        command is used.)

   21.  _g_r_e_p '_a_c_h' _j_u_n_k|_s_o_r_t|_o_p_r will search the file junk  for  the
        word  "ach",  form a file containing these lines, sort them,
        and print them on the line printer. (Use of the grep command
        is explained in the section entitled "Searching a File." The

                                 - 5 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

        use of the sort command as a filter is described in  a  note
        at  the  conclusion  of the section entitled "Sort Options."
        The use of opr as a filter is explained in "The Opr  Command
        as a Filter.")
















































                                 - 6 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX


        _A_n_s_w_e_r_s _t_o _U_n_i_t _I_I _P_r_o_f_i_c_i_e_n_c_y _T_e_s_t

    1.  The login directory  is  /_u_3/_A  (See  the  section  entitled
        "Directories.")

    2.  The pathname used to reference directory 'D' is /_u_3  /_A/_B/_D.
        (See  the  explanation  of pathnames in the section entitled
        "Pathnames.")

    3.  % _l_s /_u_3/_A/_C/_F is the command used to list the filenames  in
        directory 'F'.  (See the section entitled "Pathnames" for an
        explanation of how the ls command is used with pathnames.)

    4.  % _c_a_t /_u_3/_A/_B/_E/_G junk is the command used  to  display  the
        file  'junk' in directory 'G'. (Refer to the examples in the
        section entitled "System Directories.")

    5.  The command used to create a directory is _m_k_d_i_r.  (An expla-
        nation of the mkdir command is given in the section entitled
        "Creating Directories.")

    6.  The command used to transfer from one directory  to  another
        is  _c_h_d_i_r  _o_r   _c_d.  (An explanation of the chdir command is
        given in the section entitled "Changing Directories.")

    7.  The command used to delete a directory is  _r_m_d_i_r.   (Use  of
        the  rmdir  command  is  explained  in  the section entitled
        "Removing Directories.")

    8.  _Y_e_s you can reference another user's files without transfer-
        ring  to  that user's directory.  The advantage in transfer-
        ring to that user's directory is to simplify the forming  of
        commands  by  not  having  to specify the full pathname each
        time a file is referenced. (An explanation of the advantages
        of  transferimg  to  another  user's directory as opposed to
        merely displaying his files is given in the section entitled
        "Transferring to Another's Directory.")

    9.  _T_h_e _m_v  _a_n_d  _c_p commands are used to  copy  files  from  one
        directory  to  another.  (The  cp  and  the  mv  command are
        described in the sections entitled "Transferring Files"  and
        "The Move Command" respectively.)

   10.  You would use the 'mv' command if the file to be  copied  is
        also  to be deleted. (The deleting feature of the mv command
        is described in the section entitled "The Move Command.")

   11.  /u3/A/B/E/G/H (Use of the pwd command is  explained  in  the
        section entitled "Print Working Directory")


                                 - 7 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   12.  cp /u3/A/C/F/junk junk  (The  method  of  copying  files  is
        explained in the section entitled "Copying Files.")

   13.  chdir /u3/A/B/E (Transferring from one directory to  another
        using the chdir command is described in the section entitled
        "Changing Directories.")














































                                 - 8 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX


        _A_n_s_w_e_r_s _t_o _U_n_i_t _I_I_I _P_r_o_f_i_c_i_e_n_c_y _T_e_s_t

    1.  ed junk
        a
        I am a junk file. I'm used for
        testing commands.
        .
        w
        1,$p
        q (The use of the above commands is explained in the follow-
        ing  sections:  "Ed  Command,"  "Creating a File," "The Quit
        Command," and "Printing the Contents of the Buffer.")

    2.  -3,-1p or .-3,.-1p will display  the  3  previous  lines  of
        text.  -3p will display the text 3 lines before the previous
        line.  (For an explanation of the techniques for  displaying
        lines  of a file see the section entitled "Displaying a Sin-
        gle Line.")

    3.  .=, is used to determine the current line.  (This command is
        introduced in the section entitled "The Current Line.")

    4.  g/\$/s///gp, will delete all  $'s  from  the  file  (For  an
        explanation  of  "s"  see  "The Substitute Command." The "g"
        command is described in the  section  entitled  "The  Global
        Command.")

    5.  "i" inserts text before the indicated or current line.
        "c" will change the text  on  the  indicated  lines  to  the
        specified text.
        "m" will delete text from one place and insert it just after
        the  indicated  line.  (For an explanation of the above com-
        mands see the sections entitled "The Insert  Command,"  "The
        Change Command," and "The Move Command" respectively."

    6.  The  command "3a" will append text following the 3rd line in
        the  buffer.  (See the explanation of a in the section enti-
        tled "The Append Command.")

    7.  The command "250w junk" will create the file junk consisting
        of  line  250 of the current file.  (Use of the w command in
        this fashion is described in the "Advanced Features" section
        under the heading "The Write Command.")

    8.  The command "e junk" will read  the  file,  junk,  into  the
        buffer,  destroying the current contents.  (The characteris-
        tics of the e command are described in the section  entitled
        "The Edit Command.")



                                 - 9 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

    9.  The command,  s/.*/(&)/p,  will  enclose  the  current  line
        within parentheses, and display the line.  (The characteris-
        tics of .*  are  described  in  the  section  entitled  "The
        Repetition  Character."   The features of & are described in
        "The Line Repeat Character." The procedure for  substituting
        is  described in the section entitled "The Substitution Com-
        mand.")

   10.  "nroff -o8-20 junk" will display pages 8 thru  20,  stopping
        after  each page until the Return key is depressed.  (Use of
        the nroff command and its arguements are  described  in  the
        section entitled "Introduction to Nroff.")

   11.  The Nroff program is used for formatting files.  (This basic
        idea  is  conveyed  in the section entitled "Introduction to
        Nroff.")

   12.  The command ".pn 8" will number the first page 8.   (The  pn
        command  is  presented in the section entitled "Page Control
        Formatting.")

   13.  The  command ".ul" will underline the next  line.   (The  ul
        command  is  presented  in the section entitled "Underlining
        Text.")

   14.  .ds cs This is a characer string
        \\*(cs
        will define and display the character string, cs.   (Charac-
        ter  strings  are  covered in the section entitled "Defining
        Character Strings.")

   15.  .de mo
        .tl '\\$1 '' \\$2'
        ..
        .mo "user's name" "user's group"

        will define and display the macro, mo.  (The definition  and
        display  of  macros via arguements is covered in the section
        entitled "Arguements.")

   16.  The command ".ti 10" will indent the next line of text by 10
        spaces.   (The  ti command is presented in the section enti-
        tled "Automatic Indenting.")

   17.
            a.  ".br" will begin  a  new  line  on  the  next  line,
                whereas  ".sp" will leave a blank lne and then begin
                a new line.
            b.  ".ls" only needs to be specified once to cause blank
                lines to be inserted between lines of text, whereas,
                ".sp" must be specified before each line.

                                - 10 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

            c.  ".ad c" will  center  with  line  filling,  whereas,
                ".ce" will center with no line filling.
        (The above three commands are covered in the sections en-
        titled "Text Placement Control," "Adjusting Output Lines"
        and "Vertical Spacing.")

   18.
            a.  ".ta 10 20 30 40 " sets up tab stops to be  evey  10
                positions.
            b.  ".tr aA" will display a capital A wherever a  lower-
                case A appears.
        (The procedure for setting tab stops is covered in the
        section entitled "Defining Tabs." Use of the tr command
        is explained in the section entitled "Character Trans-
        lation.")

   19.  The current date and  page  no,  will  be  displayed  right-
        adjusted  at the top of each page.  (The procedures for set-
        ting headers is covered in the section entitled "Headers.")

   20.  The given heading structure is  produced  by  the  following
        series of commands: .P1 Book I
        .P2 Chapter I
        .P3  Verse I  (Use  of  the  numbered  paragraph  macro   is
        described  in  the section entitled "Outline Style Paragraph
        Headings.")

   21.   07/28/80                                    page 1
                              John Johnson
                              E53  x8007

        (The header macros  are  covered  in  the  section  entitled
        "Headers.")

   22.                          Unclassified
                                    |
                                    |
                                    |
          Jan. 1980
                                 Unclassified  (The   classification
        macro is presented in the section entitled "Generating Clas-
        sifications." The use of footers is described in the section
        entitled "Footers.")

   23.  ".I" can be used to underline portions of a line, an  entire
        line, or several lines, whereas, ".ul" can be used to under-
        line only an entire line  or  several  lines.   (Underlining
        with  the  I  command  is  covered  in  the section entitled
        "Underlining.")



                                - 11 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   24.
            a.  ".PP 5" will begin a paragraph with the  first  line
                being indented by 5 spaces.
            b.  'PH "EM MACROS" 0 2 2 2' will generate  a  paragraph
                with  an underlined heading.  The paragraph will not
                be indented, but will be preceded and followed by  2
                blank lines.
        (The PP and PH macros are presented in the sections entitled
        "Paragraph Formation" and "Paragraph Headings" re-
         spectively.)

   25.  .L1 "" 1 I "" .
        AAAAAA
        .L2 "" 1 A ( )
        BBBBBB
        .L2
        CCCCCC
        .E2
        .L1
        DDDDDD
        .L2
        EEEEEE
        .L3
        FFFFFFF
        .L3
        GGGGGG
        .E3
        .E2
        .E1
                                                                                                                                                                                                                                                                                                                               (The
                                                                                                                                                                                                                                                                                                                               list
                                                                                                                                                                                                                                                                                                                               mac-
                                                                                                                                                                                                                                                                                                                               ros
                                                                                                                                                                                                                                                                                                                               are
                                                                                                                                                                                                                                                                                                                               presented
                                                                                                                                                                                                                                                                                                                               in
                                                                                                                                                                                                                                                                                                                               the
                                                                                                                                                                                                                                                                                                                               sec-
                                                                                                                                                                                                                                                                                                                               tion
                                                                                                                                                                                                                                                                                                                               enti-
                                                                                                                                                                                                                                                                                                                               tled
                                                                                                                                                                                                                                                                                                                               "Form-
                                                                                                                                                                                                                                                                                                                               ing
                                                                                                                                                                                                                                                                                                                               Out-
                                                                                                                                                                                                                                                                                                                               lines.")







                                - 12 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX


        _A_n_s_w_e_r_s _t_o _U_n_i_t _I_V _P_r_o_f_i_c_i_e_n_c_y _T_e_s_t

    1.  _e _j_u_n_k _2_0 _5, will invoke the Rand editor with junk being the
        current  file.   Line  20  will  be  the  first line of text
        displayed; and each line will begin with the 5th  character.
        (The  editor  command  is  presented in the section entitled
        "The Editor Command.")

    2.  <_c_t_r_l _B> _o_r _U_S_E is used to transfer from the current file to
        an  alternate  file.   (The USE function is described in the
        latter part of the section entitled "Copying and Reposition-
        ing Text.")

    3.
            a.  <_s_c_r_o_l_l _u_p> will advance  the  window  10  lines  or
                approximately half the screen.
            b.  <_b_r_e_a_k> _1_5 <_s_t_r_o_l_l _u_p> will advance  the  window  15
                lines.
            c.  <_n_e_x_t _p_a_g_e> will advance the window 22 lines  or  to
                the next page.
        (The scroll up function is described in the section entitled
        "Scanning a File." The next page function is presented in the
        section entitled "Paging.")

    4.  The <_F_2> _o_r _P_O_R_T=> function would be used to view text  that
        extends  beyond  the edge of the screen.  (The port function
        is described in the section entitled "Scaning a File.")

    5.  <_b_r_e_a_k> _1_0 <_F_1> _o_r <_b_r_e_a_k> _1_0 _P_O_R_T<= will  shift  characters
        10  positions  to the right.  (This feature of the port com-
        mand is  described  in  the  section  entitled  "Scanning  a
        File.")

    6.  <_b_r_e_a_k> _2_3_0 <_F_7> _o_r <_b_r_e_a_k> _2_3_0 _G_O _T_O will display line  230
        of  the  current file as the current line.  (Use of the GOTO
        function in this manner is described in the section entitled
        "More on Scanning.")

    7.  The _R_U_B_O_U_T key terminates the editor.  (The use of RUBOUT to
        exit  the editor is covered in the section entitled "Leaving
        the Editor.")

    8.  _j_u_n_k._b_a_k will be assigned to the unmodified version of junk.
        (The  topic  of backup files is covered in the section enti-
        tled "Leaving the Editor.")

    9.  The <_h_o_m_e> key is used to move the cursor to the top of  the
        page.   (The  characteristics of the HOME key are covered in
        the section entitled "Modifying a File.")


                                - 13 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   10.  The _i_n_s _c_h_a_r key is used take the terminal out of the insert
        mode.   (The INS CHAR key is covered in the section entitled
        "Inserting Text.")

   11.  <_b_r_e_a_k> _1_0 <_i_n_s _l_i_n_e> would be  typed  to  insert  10  blank
        lines  into  a file.  (Use of the INS LINE key with BREAK is
        described in the section entitled "Inserting Text.")

   12.  To delete all characters following the 10th character  on  a
        line,  you  would position the cursor under the 11th charac-
        ter, hit <break>, move the cursor at least one position past
        the  last  character on the line and then hit the <del line>
        key.  (This procedure for "selective deleting" is  described
        in the section entitled "Other Options.")

   13.
            a.  <_F_3> _o_r _P_I_C_K is used to  place  data  into  the  PUT
                buffer.
            b.  <_F_4> _o_r _P_U_T is used to place data back into the file
                from the PUT buffer.
            c.  <_F_5> _o_r +  _S_E_A_R_C_H  is  used  to  perform  a  forward
                search.
            d.  <_F_6> _o_r - _S_E_A_R_C_H  is  used  to  perform  a  backward
                search.
        (The PICK and PUT functions are described in the section
        entitled "Copying and Repositioning Text." The SEARCH keys
        are pressented in the section entitled "Searching a File.")

   14.  <_b_r_e_a_k> <_F_4> _o_r <_b_r_e_a_k> _P_U_T causes data from  the  alternate
        buffer  to be placed back into the file.  (This procedure is
        described in Note #2 of the section  entitled  "Copying  and
        Repositioning Text.")

   15.  _d_e_l_e_t_e_d _d_a_t_a is placed  into  the  alternate  buffer.   (The
        nature  of  the alternate buffer is described in the section
        entitled "Copying and Repositioning Text.")

   16.  <_c_t_r_l _z> _o_r _M_A_K_E _P_O_R_T  allows  you  to  view  several  files
        simultaneously.  (The MAKE PORT function is described in the
        section entitled "Manipulating Files Siultaneously.")

   17.  <_b_r_e_a_k> _3 <_c_t_r_l _c> _o_r <_b_r_e_a_k>  _3  _E_N_T_E_R  would  be  used  to
        reference  the file in the 3rd window.  (Referencing windows
        is covered  in  the  section  entitled  "Manipulating  Files
        Simultaneously.")

   18.  <_b_r_e_a_k> <_c_t_r_l _z> _o_r <_b_r_e_a_k> _M_A_K_E _P_O_R_T is used to remove  the
        smaller windows from the screen.  (This procedure for remov-
        ing windows is covered in trhe section entitled  "Manipulat-
        ing Files Simultaneously.")


                                - 14 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   19.  <_b_r_e_a_k> _j_u_n_k <_c_t_r_l _v> _O_R <_b_r_e_a_k> _j_u_n_k _S_A_V_E will make a  copy
        of  the current file as junk.  (The use of the SAVE function
        to rename a file is covered in the final lines of  the  sec-
        tion entitled "Manipulating Files Simultaneously")

   20.  <_b_r_e_a_k> <_F_7> _o_r <_b_r_e_a_k> _G_O _T_O is used to branch to  the  end
        of a file.  (This function is described in the section enti-
        tled "More on Scanning.")












































                                - 15 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX


        _F_i_n_a_l _E_x_a_m _K_e_y



    1.  To halt execution of a  command,  depress  the  _r_u_b_o_u_t  key.
        (See the Rubout entry in the section entitled "The Keyboard"
        - UnitI, ModuleI)

    2.  The "#" and the "@" are used for _m_a_k_i_n_g  _c_o_r_r_e_c_t_i_o_n_s.   (See
        the section entitled "Special Characters" - UnitI, ModuleI)

    3.  _r_e_m_i_n_d _m_m_w /+_3 _1_2:_0_0_a_m -_r is the command which could be used
        to  remind  you  of a meeting scheduled for 12 O'clock noon,
        three months from now.  (See the  section  entitled  "Remind
        Command" - UnitI, ModuleII)

    4.  _c_a_t _j_1 _j_2 _j_3 > _s_a_v_e will copy three files  j1,  j2,  and  j3
        into  a  file  called save.  (See the section entitled "Con-
        catenating Files" - UnitI, ModuleIII)

    5.  _c_a_t _j_u_n_k >> _j_u_n_k_2 will append  the file , junk, to the  file
        junk2.   (See the section entitled "Appending Information" -
        UnitI, ModuleIII)

    6.
            a.  cat junk will display the file junk on the  terminal
                unformatted.
            b.  pr junk will display the file junk on  the  terminal
                formatted with a header line.
            c.  opr junk will display the  file  junk  on  the  line
                printer, unformatted.
        (See the sections entitled "Cat Command," "The Print
        Command" and "Off line Print" in UnitI, Module III.)

    7.  _r_m [_a-_c]* will remove all files from  your  directory  which
        begin  with a, b, or c.  (See the section entitled "Deleting
        Files" - UnitI, ModuleIII)

    8.  _c_h_m_o_d _7_0_0 _j_u_n_k will change the mode of the file  junk,  such
        that   only   the   owner   has  read,  write,  and  execute
        priviledges.  (See the section entitles  "chmod  Command"  -
        UnitI, ModuleIII)

    9.  _s_p_l_i_t -_1_5_0_0 _j_u_n_k
        _o_p_r _x_a_a
        _o_p_r _x_a_b

        will obtain a paper listing of the file junk which  contains
        3,000  lines of text.  (See the section entitled "Segmenting
        a File" - UnitI, ModuleIV)

                                - 16 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   10.  _g_r_e_p -_v '.$' _j_u_n_k|_o_p_r will obtain a  paper  listing  of  all
        lines  of  text  in  the  file,  junk, which do not end in a
        period.  (See the section  entitled  "Searching  a  File"  -
        UnitI, ModuleIV)

   11.  _g_r_e_p -_c '^_a' _j_u_n_k will determine the number of lines of text
        in  junk which begin with an "a".  (See the section entitled
        "Searching a File" - UnitI, ModuleIV)

   12.  The parent directory of "d" is _B.  (See the section entitled
        "System directories - UnitII, ModuleI)

   13.  /_u_3/_A/_B/_D/_D_2 will be displayed if %pwd is issued.  (See  the
        section entitled "Pathnames" in UnitII, ModuleI)

   14.  _c_d _D/_D_2 will transfer you from "B" to "D2".  (See  the  sec-
        tion entitled "Changing Directories" - UnitII, ModuleII)

   15.  _m_v /_u_3/_A/_C/_F/_j_u_n_k _j_u_n_k will copy and delete  the  file  junk
        from  directory  "F".   (See  the section entitled "The Move
        Command" - UnitII, ModuleII)

   16.  _o_p_r /_u_3/_A/_C/_F/_t_e_m_p will obtain a paper listing of  the  file
        temp  located  in  directory "F".  (See the section entitled
        "Using your neighbor's files" -  UnitII,  ModuleII  and  the
        section  entitled  "The  Opr  Command  as a Filter" - UnitI,
        Module III)

   17.  _l_s -_l /_u_3/_A will list the  files  in  the  login  directory.
        (See the section entitled "Pathnaames" - UnitII, ModuleII)

   18.  _m_k_d_i_r /_u_3/_A/_C/_F/_F_1 or _c_d _F; _m_k_d_i_r _F_1 will make  a  subdirec-
        tory   "F1"  in  directory  "F".  (See the sections entitled
        "Pathnames," Creating Directories" and Transferring Files in
        UnitII, ModuleII)

   19.  _r_m_d_i_r _D/_D_1 or _c_d _D; _r_m_d_i_r _D_1 will delete the  directory  D1.
        (See  the sections entitled "Transferring Files" and "Remov-
        ing Directories" in UnitII, ModuleII)

   20.  _g/_u_n_i_x/_s//_U_N_I_X/_g_p will change all  occurrences  of  unix  to
        UNIX  and  display  the  corrected  lines.  (See the section
        entitled "The Global Command" - UnitIII, ModuleI)

   21.  /_s_o_f_t_w_a_r_e/
        //
        _s/_s_o_f_t_w_a_r_e//

        will delete the 2nd occurrence of software.  (See  the  sec-
        tions entitled "The Substitute Command" and "Other Examples"
        in UnitIII, ModuleI)

                                - 17 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   22.  /_S_u_c_h/_s/./,_w_h_o _m_a_y _b_e _c_a_r_r_y_i_n_g _o_u_t _d_i_f_f_e_r_e_n_t _t_a_s_k_s

        will insert the clause "who may be  carrying  out  different
        tasks"  following  "users."  (See  the section entitled "The
        Substitute Command" - UnitIII, ModuleI)

   23.  _a
        _F_u_r_t_h_e_r_m_o_r_e _t_h_e _U_N_I_X _s_y_s_t_e_m _i_n_c_l_u_d_e_s  _v_e_r_y  _e_f_f_e_c_t_i_v_e  _t_o_o_l_s
        _f_o_r _w_r_i_t_i_n_g _s_o_f_t_w_a_r_e.
        .

        will append the above sentence to the end of the file.  (See
        the  section  entitled "The Append Command" - UnitIII, Modu-
        leI)

   24.  _0_a
        _T_h_e _U_n_i_x _f_a_m_i_l_y _h_a_s _g_r_e_a_t_l_y _i_n_c_r_e_a_s_e_d _t_h_e _f_l_e_x_i_b_i_l_i_t_y _o_f _t_h_e
        _o_p_e_r_a_t_i_n_g _s_y_s_t_e_m.
        .

        will place the above sentence at the beginning of the  file.
        (See   the  section  entitled  "The  Append  Command"  under
        "Advanced Features" in UnitIII, ModuleI)

   25.  _6,_1_0_w _p_a_r_t will create a  file  called  part  consisting  of
        lines  6  -  10  of success.  (See the section entitled "The
        Edit Command" under "Advanced Features" in UnitIII, ModuleI)

   26.  $-_2,$_d will delete the last 3 lines of  success.   (See  the
        section  entitled "The Delete Command" and "The Dollar Sign"
        in UnitIII,ModuleI)

   27.  _w _p_a_r_t
        _e _s_u_c_c_e_s_s
        _1,$ _s/$/$/

        will place a "$" at the end of each line.  (See the sections
        entitled  "The  Edit  Command," "The Substitute Command" and
        "The Dollar Sign" in UnitIII, ModuleI)

   28.  _0_r _p_a_r_t will prepend the file "part" to success.   (See  the
        section entitled "Line numbers with read" - UnitIII,ModuleI)

   29.  _n_r_o_f_f -_o_1_0-_4_0 _m_i_s_s_i_l_e|_o_p_r will obtain  a  paper  listing  of
        pages  10 - 40 of the file, missile.  (See the section enti-
        tled "Introduction to Nroff" - UnitIII,ModuleII and the sec-
        tion  entitled  "The Opr Command as a Filter" - UnitI, Modu-
        leIII)

   30.  ._d_s _C_S _D_E_L_E_T_E _N_E_X_T _L_I_N_E and _\*(_C_S will  define  and  execute
        the   character  string,  CS.   (See  the  section  entitled

                                - 18 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

        "Defining character strings" - UnitIII,ModuleII)

   31.  ._d_e _F_M
        ._a_f % _i
        ._t_l '\_n(_m_o/\_n(_d_y/\_n(_y_r''_p_a_g_e %'
        ..
        ._w_h _0 _F_M

        will display the current date and page number in  lower-case
        Roman  numerals  at  the top of each page.  (See the section
        entitled "Define Command" - UnitIII,ModuleII)

   32.  The student's answer should resemble the following:
        _____________________________________________
        |             Table of Contents              |
        |                                            |
        |1. Book I                                1  |
        |                                            |
        | 1.1 Chapter 1                           1  |
        | 1.2 Chapter 2                           1  |
        |                                            |
        |2. Book II                                  |
        |                                            |
        |                    -i-      (current date) |
        |____________________________________________|
        (See the sections entitled "Outline  Style  Paragraph  Head-
        ings" and "Table of Contents" in UnitIII, ModuleIII)

   33.  ._t_a _1_5, _3_0, _4_5
        ._f_c /
        /_J_o_h_n, _D_o_e_f_i_e_l_d//_2_2_6-_5_0-_0_4_2_2//_G_S_1_1/

        will place the above text in columns  1,  15,  30,  and  45.
        (See    the    section    entitled    "Defining    Tabs"   -
        UnitIII,ModuleII)

   34.  ._d_e _r_e
        ._t_l ''_R_E_T_E_N_T_I_O_N _D_A_T_E: _\$_1''
        '_s_p _5
        ..
        ._r_e _1_2/_2_2/_7_8

        will display the heading centered at the top  of  the  first
        page  and  leave  5 blank lines following the heading.  (See
        the section entitled "Arguements" - UnitIII,ModuleII)

   35.  ._s_o /_u_s_r/_l_i_b/_t_m_a_c._n_m
        ._d_s _F_1
        ._d_s _C_L _C_O_N_F_I_D_E_N_T_I_A_L

        will suppress the page numbers  automatically  printed,  and

                                - 19 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

        display  "CONFIDENTIAL"  at the top and bottom of each page.
        (See the sections entitled "Footers" and "Classification"  -
        UnitIII,ModuleIII)

   36.  ._P_H "" _0 _0 _0 _0 _1 will number paragraphs in a file in  Arabic
        notation. [Note: This answer is correct so long as the sixth
        arguement to the macro is "1". The  preceeding  five  argue-
        ments  can  assume  any  value.]  (See  the section entitled
        "Paragraph Headings" - UnitIII,ModuleIII)

   37.
            a.  .ul 5--will underline the next five lines.
            b.  .E1  --signifies the end of level one text.
            c.  .PP  --will begin a paragraph and indent  the  first
                line by 8 spaces.
            d.  .ti 10-will indent the next line by 10 spaces.
            e.  .ti+10-the next line will be indented  by  10  space
                plus the number of spaces in the current indent.
           (For (A) see "Underlining Text" - UnitIII, ModuleII.  For
           (B)  see "Forming Outlines" - UnitIII, ModuleIII. For (C)
           see "Paragraph Formation" - UnitIII, ModuleIII.  For  (D)
           and (E) see "Automatic Indenting" - UnitIII, ModuleII>)

   38.  MP119 is an introductory course on _U_n_i_x for the novice.
        will be displayed.  (See the section entitled  "Underlining"
        - UnitIII,ModuleIII)

   39.  ._P_H "_U_n_i_x _C_o_m_m_a_n_d_s" _0 _0 _0 _2 _I
        ._L_1 _0 _1 _A  .
        _I_n_t_e_r-_U_s_e_r _C_o_m_m_u_n_i_c_a_t_i_o_n
        ._L_2 _8 _1 _1 ( )
        _w_r_i_t_e
        ._L_2
        _m_s_g
        ._L_2
        _s_n_d_m_s_g
        ._E_2
        ._L_1
        _U_t_i_l_i_t_y
        ._L_2
        _w_h_o
        ._L_2
        _w_h_e_r_e
        ._L_2
        _n_e_w_s
        ._E_2
        ._E_1 (See the  sections  entitled  "Paragraph  Headings"  and
        Forming Outlines" in UnitIII, ModuleIII)

   40.  _1.  <_t_e_x_t>
        _2.  <_t_e_x_t>

                                - 20 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

        _3.  <_t_e_x_t> (See the section entitled "Paragraph Headings"  -
        UnitIII,ModuleIII)

   41.  _e +_j_u_n_k _2_0 _5; will bring junk into the editor as  an  alter-
        nate  file with line 20 at the top of the window and the 5th
        character as the first character of  each  line.   (See  the
        section entitled "Editor Command" - UnitIV)

   42.  <_b_r_e_a_k>
        _5_0
        <_s_c_r_o_l_l _d_o_w_n>

        will display the 50th previous line or the begining  of  the
        file.  (See the section entitled "Scanning a File" - UnitIV)

   43.  Line 150 will be displayed as the current  line.   (See  the
        section entitled "More on Scanning" - UnitIV)

   44.  The alternate buffer holds the most recently  deleted  text.
        It  may  be referenced by: <_b_r_e_a_k>, <_P_U_T> <_F_4> (See the sec-
        tion entitled "Copying and Repositioning Text" - UnitIV)

   45.  The _P_I_C_K function keys are used to reposition text within  a
        file.   (See the section entitled "Copying and Repositioning
        Text" - UnitIV)

   46.  _D_e_l_t_a _D_a_t_a               _S_u_p_e_r_b_e_e
        <_b_r_e_a_k>  _G_O _T_O           <_b_r_e_a_k>  _F_7
        <_b_r_e_a_k>  _t_e_x_t  -_S_E_A_R_C_H   <_b_r_e_a_k>  _t_e_x_t  _F_6

        would be typed to locate the word "text", which  is  located
        near  the end of the file.  (See the sections entitled "More
        on Scanning" and "Searching a File" in UnitIV)

   47.  <_p_o_s_i_t_i_o_n _c_u_r_s_o_r _u_n_d_e_r _l_i_n_e _1> <_o_r _t_y_p_e _G_O _T_O _a_n_d _t_h_e_n _H_O_M_E>
        <_b_r_e_a_k> _1_0
        <_D_E_L _L_I_N_E>

        would be typed to delete the first 10 lines from  the  file.
        (See the section entitled "Removing Text" - UnitIV)

   48.  The MAKE PORT <ctrl z> function allows you to view more than
        one  file simultaneouly.  (See the section entitled "Manipu-
        lating Files Simultaneously" - UnitIV)

   49.  <_b_r_e_a_k> _2
        _E_N_T_E_R

        would be used to make the 2nd file the current  file.   (See
        the  section  entitled "Manipulating Files Simultaneously" -
        UnitIV)

                                - 21 -
   Course Management Manual                      Not For Student Use







   MP119                                        Introduction to UNIX

   50.  _1. _t_y_p_e _G_O _T_O _a_n_d _t_h_e_n _H_O_M_E
        _2. <_b_r_e_a_k> _1_0 _P_I_C_K
        _3. <_b_r_e_a_k> _t_e_m_p _U_S_E
        _4. _p_o_s_i_t_i_o_n _t_h_e _c_u_r_s_o_r _i_n _t_e_m_p _w_h_e_r_e _t_h_e  _l_i_n_e_s  _a_r_e  _t_o  _b_e
        _i_n_s_e_r_t_e_d.
        _5. _P_U_T <_F_4>

        (Note: for the Superbee Step 5 is F4)

        will copy 10 lines from the current  file  to  file  "temp".
        (See the section entitled "Copying and Repositioning Text" -
        UnitIV)








































                                - 22 -
   Course Management Manual                      Not For Student Use




