Main Course Webpage

CS160A Assignment 1

This assignment contains three parts. Use the Homework Submission Guidelines to help you put together a clean script file. A separate script file may be handed in for each part but make sure your submission is clean and easy to understand. You may find the Slack channel started by your peers helpful.

Part One (4 points)

Objective: Becoming familiar with simple commands including cd, pwd, ps, cat as well as transferring files between two systems. Remember, the best way to learn about what a command can accomplish is by using the man command. For example, man ps will show that this command can be used to print out current processes.

Before starting your script session for Part One, use these tips!

Create a cs160a directory in your home directory on hills and keep your file structure organized by creating a directory asmt01 under it and then another directory part1 under asmt01. Your tree structure could look like the following:

      [grwoo@agnes ~]$ tree cs160a
      cs160a
      |-- asmt01
          |-- part1
      

You can practice this part of the assignment before starting a script session. Remember:

      mkdir part1
      

creates a directory and:

      rm -r part1
      

removes a directory.

It is very easy to use cat to create a file. You simply redirect stdout to a file using the > operator. To create (or overwrite) a file named test, you can do:

      cat > test
      

Now cat will read lines from stdin (which you redirected to the file test using the above command). Now, you can type anything you want. When you are finished typing, hit enter (or return) and then use a ^D(control-D) to end the file and return to the $ prompt. You have created the file test.

You can quickly show the contents of the file test by doing:

      cat test
      

Start the Assignment (make sure that you are logged into hills to complete this assignment) script

Start in your home directory. You should have a cs160a/asmt01 directory, but asmt01 should not have a part1 directory in it. Perform the following sequence in order. Use step markers so that your assignment is easy to follow. You will be graded on how clean your script file is and step markers are very helpful for that.

Part Two (2 points)

Find out what the course Slack channel is from your peers and either ask or answer a UNIX/LINUX related question. Make sure to use your CCSF username so that I can give you points for this part.

Part Three (4 points)

For this assignment, you will copy an entire tree directory structure to your area and operate on it according to the instructions. Make sure you keep in mind the visualization of your directory tree structure. It might be helpful to run through this exercise a few times before starting your script session

It is essential when using Linux at the command-line that you know where you are in the file structure. Once you login to the Linux machines, you can use the installed binary tree to draw out visualizations of the directory file structures. Download part3 using either of the following commands:

Grab part3 using wget and unzip or from the public course area

cp -r /pub/cs/grwoo/cs160a/asmt01 .

Redo this part until you reduce the number of mistakes. Don't forget to delete your part3 directory completely between attempts.

Rename the script output file to asmt01p3.script when you are finished. After examining it, transfer it to your local machine and upload to Canvas

Upload your two files asmt01p1.script and asmt01p3.script to Canvas. Your homework will be graded based upon readability. Use step markers as much as you can!