CSC161 2010F Imperative Problem Solving

Assignment 1: Getting Started with Linux

Assigned: Monday, 30 August 2010
Due: 11:00 p.m., Wednesday, 1 September 2010
No extensions!

This assignment is also available in PDF.

Summary: In this assignment, you will answer a few basic questions about and using common (and perhaps not-so-common) GNU/Linux commands.

Purposes: To give you more opportunity to learn about GNU/Linux. To get you used to turning in assignments on Wednesday evenings.

Expected Time: One hour.

Collaboration: You may certainly work with other students as you explore the problems and develop answers. However, each student should turn in his or her own responses to this assignment and should document any collaboration. You may also discuss the assignment with anyone you wish, but should clearly document that help.

Submitting: Email me your answers.

Warning: So that this assignment is a learning experience for everyone, I may spend class time publicly critiquing your work.


Answer the following questions.

1. Provide commands to create directories for this course (CSC161) and for this assignment (hw1, within the CSC161 directory) within your home directory. You should not assume that the present working directory is your home directory, and you should not change directories.

2. What is the purpose of the option -i when used with the GNU utility grep?

3. Where in the file system hierarchy is the GNU utility touch located? Please answer this question and also tell me the process you used to find it.

4. There are eight sections of the Unix manual. Different sections collect different kinds of reference material. Determine the purpose of each section.

5. Create a file named -f with the following commands.

cat > -f

(Note that <ctrl-d> means hold down the control key and press the d key while continuing to hold down the control key.)

Now, figure out how to get rid of that file. (In your answer, simply give the instructions for getting rid of the file.)

6. When you learned the chmod command, you learned it with absolute numeric permissions (e.g., 711 for I can read, write, and execute; everyone else can only execute). However, chmod also permits more mnemonic parameters. Read the man page and then indicate how to do the following using the mnemonic parameters:

7. As you may recall, the file /home/rebelsky/share/linux/sciencefac.txt contains an outdated list of science faculty at Grinnell. Write a command that presents all science faculty whose name includes David, alphabeticaly by last name. You will need to use the grep and sort commands, as well as I/O redirection with |.

8. Write a similar command that gives a list of all the science faculty not in Psychology.

Extra Credit

What happens to history when you have two open terminal windows? Devise an experiment to answer the question and then support the results of you experiment by referring to the documention.

Important Evaluation Criteria

I will evaluate your work on correctness, clarity, and concision. You may find that the latter two criteria conflict with each other.

Submitting Your Homework

Please submit this work via an email message entitled should be titled CSC161 Assignment 1.

Please send your work as the body of an email message. I don't like attachments and prefer not to receive them when they can be avoided.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Mon Aug 30 11:29:04 2010.
The source to the document was last modified on Mon Aug 30 11:29:02 2010.
This document may be found at

Samuel A. Rebelsky,

Copyright © 2010 Samuel A. Rebelsky. This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.