| CSC 161 | Grinnell College | Spring, 2012 |
| Imperative Problem Solving and Data Structures | ||
This laboratory exercise continues the previous lab to discuss more Linux utilities and prepare you for compiling with the robots.
This lab continues work with the following basic capabilities and commands.
| Topic Category | Subtopics | Linux Commands |
|---|---|---|
| Permissions | user, group, world | ls -l |
| setting permissions | chmod |
Before progressing further in this lab, be sure you have completed the readings for this lab.
As with the previous lab, most work for this lab involves experimentation with a terminal window.
The following steps ask you to review the permissions for your account directories and adjust them for this course.
Move to your home directory and obtain a "long" listing of the files present using the commands:
cd ls -l
(The cd command without parameters takes you to your home directory.)
Interpret the meaning of each part of the directory and file listings.
For CSC 161, it seems likely that you will want others in the class to be able to read your labs, since you are collaborating with others on that material. However, you do not want others to be able to read your supplemental problems. These steps set up this framework.
Move to your home directory.
Allow others to read (but not change) your login directory with the command:
chmod 755 .
Next allow others to read (but not change) files in your labs directory:
chmod 755 labs
Now use the ls -l -a command to check that others can read your home directory and the labs subdirectory, but no other directories.
Team up with another class member to check which directories of theirs you can read.
Now suppose you set your home directory with the command:
chmod 711 ~
Can others obtain a listing of your home directory?
Can others obtain a listing of your labs subdirectory?
Consider what access you want others to have to your home directory and set it accordingly. Unless you want to protect a file against your own inadventent editing, you likely will want to retain 7 at the beginning of the chmod permission list.
Development of laboratory exercises is an iterative process. Prof. Walker welcomes your feedback! Feel free to talk to him during class or stop by his office.