CS 9E - Practice Quiz 1

Fundamentals

Background

Overview

This practice quiz is designed to prepare you for your first quiz. The length and difficulty should match the real quiz, while the exact material covered may be different. On the real quiz, you may see any material covered in the first unit readings.

Suggested Exercises

In addition to this practice quiz, we suggest you attempt the following book exercises to prepare you for the quiz.

Das: 1.7, 1.10-1.12, 1.15, 2.10, 2.15, 2.16, 3.9, 3.15, 4.4, 4.5, 4.9-4.11, 7.1, 7.23-7.25, 7.27, 8.2, 8.10-8.12, 8.17, 9.6-9.9, 9.11-9.18, 10.1-10.3, 10.5, 10.6, 10.17, 10.20

Practice Quiz

Question 1

Given the directory listing below, answer the following questions.

~ $ ls -al q1
total 16
dr-xr-x---   2 me users 4096 2006-09-29 13:58 .
drwx--x--x 127 me users 8192 2006-09-29 13:58 ..
-r--r-----   1 me users   42 2006-09-29 13:58 data
  1. Do you have sufficient permissions to edit the file 'data'? Explain.
  2. Do you have sufficient permissions to delete the file 'data'? Explain.
  3. Do you have sufficient permissions to add new files to the 'q1' directory? Explain.
  4. Do you have sufficient permissions to delete the 'q1' directory? Explain.

Question 2

Marrio woke up this morning and decided to get a present for Princess Peach. He has a file named 'given' listing all the presents he has given her in the past two months. He has another file 'desired' in which Peach listed all the presents she wanted. Toad just sent Mario another file called 'for_sale' in which Toad lists all the items he has for sale today. Each file has one item per line.

Example:

Banana Peel
Red Shell
Gold Mushroom

Create a series of commands to help Mario figure out what to buy Peach. The result should be a list of items which Peach wants, Toad has in stock, and which Mario has not bought her already.

Question 3

As part of your research, you need to run an 'analisis.sh' script. This time, however, it's taking longer to execute than usual, and you would like to move it from the foreground to the background. What key strokes and commands should you use to make this happen?