CSCI 243 UNIX/VMS Operating Systems

Final Exam 2012

 

Instructions: The usual…answer all questions completely and concisely.  Show all work in order to receive any partial credit.  Write legibly, because if I can’t read it I have to assume that it’s wrong.  This exam is closed book, closed notes, closed computer, closed cell phone, etc, etc, and (hopefully) open brain.  Read through the entire exam first before starting to answer any questions so that you do the easy questions first to maximize your score.  There are a total of 140 points on the test, not counting the Sudoku.  Good luck, and have fun!

 

1.    (2 points each—40 points) Write the NUMBER of the matching action in the blank by the appropriate command or library:

_________

a.   delete a file

2.     alias

_________

b.   copy a file to another directory

3.     at

_________

c.   type the contents of a file without pausing

4.     bc

_________

d.   view the contents of a file one screen at a time

5.     cat

_________

e.   find out who is currently logged in

6.     cc

_________

f.    list all processes running on the machine

7.     chgrp

_________

g.   view a specific manual page

8.     chmod

_________

h.   change the permissions on a file

9.     chown

_________

g.   end a running job

10.  cp

_________

h.   edit a text file

11.  date

_________

i.    find a string in a file

12.  echo

_________

j.    print the value of a shell variable

13.  exit

_________

k.   build a parser from an input file

14.  export

_________

l.    update one or more files as needed

15.  for

_________

m.  compile a C program

16.  grep

_________

n.   library for moving the cursor in a text window

17.  help

_________

o.   program to remove multiple occurrences of an item

18.  kill

_________

p.   arrange contents of a file in order

19.  make

_________

q.   change the ownership of a file

20.  man

_________

r.    wait a certain number of seconds

21.  more

_________

s.   print or set the current date and time

22.  ncurses

_________

t.    become another user without logging out

23.  print

 

 

24.  ps

 

 

25.  rm

 

 

26.  sleep

 

 

27.  sort

 

 

28.  su

 

 

29.  time

 

 

30.  uniq

 

 

31.  vi

 

 

32.  who

 

 

33.  whoami

 

 

34.  whatis

 

 

35.  yacc

 

 

36.  none of the above

 

  1.  (3 points each—36 points)  Short answer:

a.    What would you type to switch to your home directory?

 

 

 

 

 

 

b.    What would you type to switch to the directory you were in just before the current directory?

 

 

 

 

 

 

c.    How would you switch to the parent directory of the current directory?

 

 

 

 

 

 

d.    Using the mask 755 to set the permissions gives what permissions to all users?

 

 

 

 

 

 

e.    Describe how to pass the output of one program to the input of a second program.

 

 

 

 

 

 

f.     How do you capture the output of a program to a file?

 

 

 

 

 

 

 

 

 

 

g.    To switch from insert mode to the command mode, what key do you press in vi?

 

 

 

 

 

 

h.    What change do you need to make to your path in order to run programs in your current working directory just by typing their names?

 

 

 

 

 

 

i.      What options do you pass to the process status command to see all running processes and not just the ones you own?

 

 

 

 

 

 

j.      What types of files do not normally show up in a file listing?

 

 

 

 

 

 

k.    What program do you run to find the load average, how much memory is being used, etc?

 

 

 

 

 

 

l.      What options do you pass to ls to see all files (including hidden ones) and also to see the owners, permissions, sizes, time stamps, etc?

 

 

 

 

 

 

 

 

 

 

3.    (4 points each…24 points total)  Slightly longer answers…

a.    What are three major services an operating system provides?

 

 

 

 

 

 

 

 

 

b.    Does the average completion time depend on the order in which the jobs are run?  Explain.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

c.    What is the best page replacement scheme?  Why can’t we use it in an operating system?

 

 

 

 

 

 

 

 

 

 

 

d.    What is the difference between cooperative and preemptive multitasking?

 

 

 

 

 

 

 

 

e.    What are the advantages and disadvantages of using NFS instead of local files?

 

 

 

 

 

 

 

 

 

 

 

 

f.     What system is LaTeX built on top of?

 

 

 

 

 

 

 

 

 

 

 


Bonus: (5 points each)

Fill in the boxes below so that each row, each column, and each highlighted 3x3 square contains each of the digits 1 through 9 exactly once.  Obviously when  you are done, there should be 9 copies of each digit on the grid, and no row, column, or 3x3 square should contain two of the same digit.

 

 

 

 

 

7

 

 

5

 

 

4

 

6

8

 

 

 

 

1

6

9

 

 

 

 

 

 

 

 

8

 

 

 

 

 

9

 

2

 

1

 

3

 

7

 

4

 

 

 

 

 

1

 

 

 

 

 

 

 

 

7

6

3

 

 

 

 

2

9

 

4

 

 

7

 

 

4

 

 

 

 

 

Henry has been caught stealing cattle, and is brought into town for justice. The judge is his ex-wife Gretchen, who wants to show him some sympathy, but the law clearly calls for two shots to be taken at Henry from close range. To make things a little better for Henry, Gretchen tells him she will place two bullets into a six-chambered revolver in successive order. She will spin the chamber, close it, and take one shot. If Henry is still alive, she will then either take another shot, or spin the chamber again before shooting.

 

Henry is a bit incredulous that his own ex-wife would carry out the punishment, and a bit sad that she was always such a rule follower. He steels himself as Gretchen loads the chambers, spins the revolver, and pulls the trigger. Whew! It was blank. Then Gretchen asks, 'Do you want me to pull the trigger again, or should I spin the chamber a second time before pulling the trigger?'

 

What should Henry choose?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The Bay of Bengal is in which state?  (Careful…tricky question!!)