Sonoma State University

Department of Computer Science

CS-210: Introduction to Unix

Exercise 3

Objective:

In this exercise, you will practice with more file utility commands discussed in our textbook.

Instructions:

After entering your login credentials in a secure shell on blue.cs.sonoma.edu, please perform the following tasks:

  1. cd ~/cs210_exercises/cs210_exercise_3
  2. wget https://www.robertjamesbruce.com/programming_exercises/cs210/fall_2026/cs210_exercise_3.tgz
  3. tar xzf cs210_exercise_3.tgz

Question 1:

What are the differences between the "less" command and the "more" command?

Type the following commands (when you are finished type the "q" key):

  1. more CHAPTER_5-The_Wonderful_Wizard_of_Oz.txt
  2. less CHAPTER_5-The_Wonderful_Wizard_of_Oz.txt

Question 2:

What is the command line option for "rm" to interactively prompt you before deleting files?

Question 3:

How could the "alias" command be used with "rm" to interactively prompt you for confirmation by default?

Question 4:

How could you determine if the command "rm" is really an alias?

Submission Instructions:

Please submit your answers to Canvas for the questions above.

Exercise 3 Rubric

CRITERIA RATINGS POINTS
Question 1: Proficient
0.5 points

Student's answer compares the "less" and "more" commands and denotes how these two commands differ in features and capabilities when viewing a text file. Furthermore, the student notes how the "less" and "more" commands differ when one enters quit or exits each command.
Satisfactory
0.35 points

Student's answer describes the features and/or capabilities of either the "less" or the "more" command but not both; OR student's answer contains no comparison which differentiates the capability of both "less" and "more" commands.
Below Expectation
0 points

Student provided no solution.
0.5 points
Question 2: Proficient
0.5 points

Student's solution uses the "rm" command with appropriate command line option and is syntactically-correct. If student's solution is entered in a secure-shell on the Blue Unix server, it will work as expected by prompting the user with a confirmation before deleting a file.
Satisfactory
0.35 points

Student's solution uses the "rm" command but is missing a required command-line option; OR command-line options are included which have no relevance to prompting for user confirmation; OR syntactically-incorrect command-line options are included. If the student's solution were entered as-is on a secure shell on Blue, it would fail to prompt the user for a confirmation before deleting the file; OR the rm command would do nothing due to a syntax error.
Below Expectation
0 points

Student provided no solution.
0.5 points
Question 3: Proficient
0.5 points

Student's solution uses the "alias" command with "rm" and one additional command line argument. Student's solution is syntactically-valid. If student's solution is entered on a secure-shell on the Blue Unix server, the "rm" command will then prompt the user with a confirmation before deleting a file.
Satisfactory
0.35 points

Student solution uses alias but is missing required additional command line arguments; OR additional command line arguments are included which are irrelevant or syntactically incorrect. If the student's solution were entered as-is on a secure shell on Blue, invoking "rm" would not prompt the user with confirmation before deleting a file OR the "rm" command would generate a syntax error.
Below Expectation
0 points

Student provided no solution or did not use alias.
0.5 points
Question 4: Proficient
0.5 points

Student provided at least ONE exact, syntactically-correct Unix command someone could issue on the Blue Unix server to determine if "rm" is an alias. If the student's command were entered in a secure shell on Blue, it would properly determine if "rm" were an alias).
Satisfactory
0.35 points

Student provided at least one partially-correct solution. The student's answer is missing required command line arguments. If the student's solution were entered as-is on a secure shell on Blue, it would fail to determine if "rm" were an alias.
Below Expectation
0 points

Student provided no solution.
0.5 points
Total points: 2