.ds F1 - % -
.ds Fd  ~
.ds F3  ~
.ds Fl  Final~Exam
.ds Fr  Answer~on~this~Sheet
.ds H1  ~
.ds Hl MP119
.ds Hr Introduction to Unix
.bp
.PH "~~~~~~~~~~Unix Final Exam
.sp 2
Name:_________________________Date:_________________
.sp
.L1 5 2 1
To halt execution of a command, depress the ___________key.
.L1
The "#" and the "@" are used for __________________________.
.L1
Write the command which could be used to remind you  of a
meeting scheduled for 12 O'clock noon, three days from now.
.sp 0.5i
.L1
Write the command to copy three files, j1, j2, and j3 into a
file called "save".
.sp 0.5i
.L1
Write the command to append the file junk to the file junk2.
.L1
Contrast the following commands:
.L2
 cat junk
.sp 0.5i
.L2
 pr junk
.sp 0.5i
.L2
 opr junk
.sp 0.5i
.E2
.L1
Write the command used to delete all files from your directory
which begin with one of the letters: a, b, or c.
.sp 0.5i
.L1
Write the command to change the mode of a file named junk, such
that only the owner has read, write, and execute priviledges.
.sp 0.5i
.L1
You have a file named junk which contains 3,000 lines of text.
Write the necessary commands to obtain a paper listing of the file.
.sp 1.0i
.L1
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.
.sp 0.5i
.L1
Write the command to determine the number of lines of text in junk
that begin with an "a".
.sp 0.5i
'ne 15
.sp
Use the following network of directories to answer questions 12-19:
.nf

			/u3/A

			/  \\

		      /      \\

		    B         C

		   /        /   \\

		 /         /      \\

		D        C1           F

	      /  \\

	     /     \\

	    D1      D2
.fi
.sp
.L1
The parent directory of directory "D" is ________________________.
.L1
The current directory is "D2"; what will be displayed if the command,
%pwd, is issued? _____________________.
.L1
The current directory is "B"; write the command you would use to transfer
to directory "D2" ____________________.
.L1
The current directory is "D1"; write the command to copy and delete the
file, junk, from directory "F". ________________.
.L1
The current directory is "C1";  write the command to obtain a paper listing
of the file "temp" which is located in directory "F". ____________________.
.L1
The current directory is "D1"; write the command to list the filenames
in the login directory. _______________________.
.L1
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".
_________________.
.L1
The current directory is "B"; write the command/commands to delete
directory "D1". ___________________.
.ne 15
.sp
Assume that you are using the Unix Text editor, and the following
file,"success", to answer questions 20-28.
.sp
.ul
success:
.sp
.nf
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.
.fi
.sp
.ti +17
Write commands to:
.sp
.L1
Change the word unix to UNIX throughout the file and display the
corrected lines.
.sp 2
.L1
Delete the second occurrence of software.
.sp 0.5i
.L1
Insert the clause, " who may be carrying out different tasks.",
following "users,".
.sp 0.5i
.L1
Append the following sentence to the end of the file:
.sp
"Furthermore, the UNIX system includes very effective tools for writing
software.".
.sp 2
.L1
Append the following sentence to the beginning of the file:
.sp
The Unix family has greatly increased the flexibility of the operating
system.".
.sp 0.5i
.L1
Create a file called "part" consisting of lines 6 - 10 of success.
.sp 0.5i
.L1
Delete the last 3 lines of success.
.sp 2
.L1
The current file is "part"; modify the file, "success", such that a dollar
sign is placed at the end of each line.
.sp 0.5i
.L1
The current file is "success"; prepend the file, "part", to it.
.sp 2
Assume the you are using nroff and the nm macro package for the
following questions.
.sp
.L1
Write the command to obtain a paper listing of pages 10-40 of a file
named, misile.
.sp 0.5i
.L1
Write the commands to define and execute a character string, CS, which
contains the phrase "DELETE NEXT LINE".
.sp 0.5i
.L1
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.
.ne 15
.sp 3
.L1
Make a simple display showing what will be produced by the following
series of commands:
.sp
.tr #~
.in +10
\&.P1 Book#I
.br
<text>
.br
\&.P2 Chapter#1
.br
<text>
.br
\&.P2 Chapter#2
.br
<text>
.br
\&.P1 Book#II
.br
<text>
.br
\&.TC
.tr ##
.in -10
.sp 5
.L1
Write the commands and format the following text such that the fields
begin in print positions 1, 15, 30, and 45, respectively.
.sp
John, Doefield~~~~~~226-50-0422~~~~~E21~~~~~GS11
.sp 2
.L1
Write the commands to define and execute a macro, re, which displays
the retention date for certain blocks of text, eg.
.sp
.ti +15
RETENTION DATE:  12-22-78
.sp
TO DO: 1. Use arguments to pass the date to the macro.
.br
~~~~~~~2. Center the above line.
.br
~~~~~~~3. Leave 5 blank lines following the above line.
.sp 4
.L1
Write the necessary commands to format a file that suppresses the page
number and displays "CONFIDENTIAL" at the top and bottom of each page.
.sp 3
.L1
Write the command to number paragraphs in a file using  the Arabic notation.
'ne 10
.sp 0.5i
.L1
Analyze the following commands:
.L2
\&.ul 5
.L2
\&.E1
.L2
\&.PP 8
.L2
\&.ti 10
.L2
\&.ti +10
.E2
.sp 0.5i
.L1
What will be displayed by the following:
.sp
.in 5
MP119 is an introductory course on
.br
\&.I Unix
.br
for the novice.
.in -5
.ne 50
.L1
Show how the file would appear to produce the following:
.sp
.ul
I.~"Unix commands"
.br
~~~~~A. Inter-user Communication
.br
~~~~~~~~(1) write
.br
~~~~~~~~(2) msg
.br
~~~~~~~~(3) sndmsg
.br
~~~~~B. Utility
.br
~~~~~~~~(1) who
.br
~~~~~~~~(2) where
.br
~~~~~~~~(3) news
.sp 15
.L1
What will be displayed by the following:
.sp
.in 5
\&.PH "" 0 2 0 0 1
.br
<text>
.br
\&.PH
.br
<text>
.br
\&.PH
.br
<text>
.in -5
.sp
Assume that you are using the RAND editor for the following questions:
.sp
.sp 3
.L1
Analyze the following command:
.sp
.ti +15
editor +junk 20 5
.sp 0.5i
.L1
What would you type to scroll the file back 50 lines?
.sp 3
.L1
What will be the result of typing the  following?
.sp
.in 15
<BREAK>
.br
150
.br
<GO TO>
.in -15
.sp 0.5i
.L1
What is the purpose of the alternate buffer (also called the close and
delete buffer); and how may its contents be referenced?
.sp 0.5i
.L1
Which function keys are used to reposition text within a file?
.sp 0.5i
.L1
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?
.sp 3
.L1
What would you type to delete the first 10 lines from the current file?
.sp 3
.L1
What is the purpose of using MAKE PORT ?
.so 0.5i
.L1
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?
.sp 2
.L1
You are editing a file named "junk"; what would you type to copy the
first 10 lines from "junk" to "temp"?
.sp 5
.E1
.E2
