CS 21: Algorithmic Problem Solving

 

Homework #1: Basic Unix Skills

Due 11:59pm Tuesday, January 30

This homework will require that you be able to perform some basic Unix commands. Although this material will not be formally taught in class, there will be a "Using Unix" class this Wednesday evening taught by Meggie Ladlow, one of the student system administrators. The class will be held during the regularly scheduled Wednesday study sessions (7-9 pm, Science Center 252). You are strongly encouraged to attend this session. If you have scheduling problems, you can receive some assistance at the Sunday evening study session (also 7-9 pm, Sci Ctr 252), but there will be no formal class on Sunday evening.

You will need to be familiar with the following concepts and commands in order to complete this homework:

To begin the assignment, open a Terminal window. You do this by clicking on the black square in the center of the toolbar terminal or by clicking on the XFCE menu button xfcemenu and then choosing "Terminal". When the Terminal window opens, you will see the shell prompt which will look something like this:
lemon[~]$

In the above prompt, lemon is the name of the machine you are working on, so this may be different for you if you are working on a different machine.

Once you have a Terminal window open, type update21 and press enter. The update21 command will create directories in your account and copy files from the "CS21 Library" into these directories. You should get in the habit of running update21 every time you come to class and before you begin homework assignments to be sure that your library of files is up to date.

The remainder of the homework description will have a much less explanatory information in it. It is assumed that you either already know how to do the things its asking you to do (which is unlikely) or that you will learn this in the Using Unix session on Wednesday evening.

  1. Go to your ~/cs21/homework/1/Q1/ directory. Which files are in this directory? Which file is the largest and which is the smallest? What is your current working directory? Send me an email at adanner (using pine or mutt) from your CS account which contains these answers.
  2. Go to your ~/cs21/homework/1/Q2/ directory. Make a copy of the file hello.py, calling the new copy hello-backup.py.
  3. Continuing in the ~/cs21/homework/1/Q2/ directory, rename the file tyop.py to typo.py. Then, edit the file (using idle) and fix the typos in the file.
  4. Continuing in the ~/cs21/homework/1/Q2/ directory, delete the file deleteme.py
  5. Go back to the ~/cs21/homework/1/ directory and remove the subdirectory called Q3.
  6. Continuing in the ~/cs21/homework/1/ directory, create a new subdirectory called Q4.
  7. In the ~/cs21/homework/1/Q5 directory, there are 4 files. View the contents of each of these files and copy all the files that say "COPY ME" into the newly-created Q4 directory.
  8. Run handin21 to turn in the results of this homework.
  9. When you are done, close any open windows and logout of the system.

Remember, you are not expected to know how to do any of these commands; however, you will learn how to do all of this (and more!) by attending the Wednesday evening study session on Using Unix.