


   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




