Unix Homework

Homework to create a structure of folder (directories) and files in your Unix account on Tempest. You'll also create your first HTML files.

Purpose

Working with folders and files is not hard but it's an essential skill. Students in CS 204 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.

Pair Programming

I will assign partners for this, but each person will do the work and turn it in. The partnerships will allow you to talk to someone about the steps in the assignment and such, as well as building camaraderie.

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.

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 public_html 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. Don't create the enclosing public_html folder; you already have that. Anything else that already exists, say because of in-class instructions or exercises, can also be kept.

public_html/
    cs204/
        unix/
            downloads/
                empty.html
            empty.text

Note that names that end with a slash are the names of folders; the contents of the folders are indented under them. There are no empty folders. The empty.html and empty.text files are empty files, and they are in different folders, as the indentation shows.

Structure to Copy

The above are all empty files. In this step, you'll copy some existing stuff from the cs204 course account in the pub directory. 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/orig folder to the downloads folder you created above.
  2. Name (or rename) the copied folder to be orig_copy
  3. Copy the readings/template.html file to your unix folder as page1.html

Note that I haven't given you the exact pathnames here, but the information above is sufficient if you understand it and interpret it correctly. You can use ls to confirm your understanding.

Files to Edit

Using VS Code, edit the page1.html file to contain your name in place of the filler text in the title and h1 elements.

Screenshot

View your webpage in a web browser and make a screenshot that includes the URL and your name in the H1 element. If you don't know how to make a screenshot on your computer, search the web or talk to me or the tutors.

Upload that screenshot to the same folder as the page1.html.

Rename the screenshot file to be screenshot1.png (or whatever file extension is appropriate -- Mac screenshots and Windows both create PNG files so that's probably correct).

Edit the page to show the screenshot after the h1 header. (Yes, this is slightly recursive: the page now displays a screenshot of the prior version. We could iterate this process for fun, but let's not.)

Create a Tarball

You're now done. This step creates the file you will turn in.

  1. Go to the cs204 folder in your public_html directory
  2. Create a tarfile of your unix directory tree. Call it unix.tar:
tar cf unix.tar unix

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:

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

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, cs304 and the name of the file, unix.tar. It looks like this.

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

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

drop cs204 unix.tar

Once you've submitted your tarfile, you can delete it. But there's no harm in keeping it, either.

Gradescope

Even though I encourage pair work in this assignment and throughout the semester, for this assignment, I'm asking for individual dropped unix.tar files and individual Gradescope submissions. The reason is simply that part of the purpose of this assignment is to ensure that people can do the basic operations.

  1. Create an empty Google Doc.
  2. Write in it a sentence like: Ron Weasley and I (Hermione Granger) worked together on this. I dropped from my account: hgranger. If you worked alone, just say that.
  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.

Time and Work

The following link has been updated for Fall 2023.

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