Unix Homework

Homework to create a structure of folder (directories) and files in your Unix account on Tempest.

Purpose

Working with folders and files is not hard but it's an essential skill. Students in CS 304 sometimes stumble at the beginning of an assignment, needing help in copying the requisite files and folders, dealing with errors that occur, and setting things up correctly.

I don't mind helping with those steps, but it's more empowering for you to not need help.

Terminology

On Unix systems, the word directory is the standard term, with folder being a more recent synonym. I like the alliteration of "files and folders" but I also like the tradition of "directory". Furthermore, the word "directory" makes commands like "cd" (change directory), "pwd" (print working directory) and the like more clear.

The words are perfect synonyms, though, so don't let this confuse you.

Reference

All the skills for this assignment are covered in the unix reference and the Google Presentation on Unix.

Time

Historically, this takes almost everyone less than 3 hours to complete. If it's taken you that long and you're not done, stop and get some help.

Task

You'll set up some files and folders for your use in this course. There will be some extra files and folders in there, just for the purposes of this assignment.

You'll also create a tarfile and submit it for grading.

Structure to Create

In your home directory, create some folders for this semester. The following is indented to show structure. Anything ending with a slash is a folder. Files will have a dot in their names.

cs304/
    assignments/
        a1/
            name.text
    downloads/
        ex1/
            example.py
    project/
        draft/
        alpha/
        beta/

Structure to Copy

The above are all empty files. Here, you'll copy some existing stuff from the cs304flask course account in the pub directory. I'm being a little coy about describing where these files are, so that you'll need to use ls and other tools to find them before copying them. Think of it as a scavenger hunt. But don't spend too long on it; I'm not expecting hours of hunting around. A few minutes will suffice, once you figure out where the home directory of the course account is. If you get stuck, feel free to contact me.

Since the directories that you are copying will have stuff in them, you should use a recursive copy, unless you want to copy all the contents one at a time.

  1. Copy the downloads/mysql1-queries folder to your downloads folder
  2. Name (or rename) the copied folder to be part1_copy
  3. Copy the downloads/python folder to your downloads folder

Files to Edit

Using VS Code, edit the name.text file in your a1 assignment folder to contain your name.

Create a Tarball

This step creates the file you will turn in.

  1. Go to your home directory
  2. Create a tarfile of your cs304 directory tree. Call it unix.tar:
tar cf unix.tar cs304

Checking your Work

Before submitting your tarfile, you can use the check-unix-assignment command in the course pub/bin directory. It takes your tarfile as a command line argument:

~cs304flask/pub/bin/check-unix-assignment your_tarfile_here

That script checks that your tarfile has all the required files in it, by comparing to one I created. However, if there are extra files in yours, say downloads from the second day of class, it'll report those differences. You can safely ignore complaints about extra files. But pay attention to anything that is missing or different.

Submission

Finally, use the drop command to submit your tarfile to the course drop folder. That command takes two command line arguments: (1) the name of course, cs304flask and the name of the file, unix.tar. It looks like this.

[anderson@tempest ~]$ drop cs304flask unix.tar 
Copying unix.tar (from anderson) to /home/cs304flask/drop/ (uid 1942) 
Successful drop. 

Here's the command, suitable for copy/pasting:

drop cs304flask unix.tar

Once you've submitted your tarfile, you can delete it. Or move it to your assignments folder.

Gradescope

  1. Create an empty Google Doc.
  2. Write in it a sentence like: I (Hermione Granger) dropped from my account: hgranger.
  3. It's helpful to remind me of the account name; I don't always remember the account that goes with your name.
  4. I can then grade the file you dropped
  5. Use the File menu to download the page as a PDF (or print it and save as PDF).
  6. Upload the PDF to Gradescope.

You'll do this for every assignment. That's (1) how I you are done and (2) how I give feedback and scores.

Time and Work

The following link has been updated for Fall 2024.

Finally, when you have completed the assignment, make sure you fill out the Time and Work Fall 2024 That report is required.