CMSC 104, Spring 2014
Homework 1
Out: Wednesday 2/12/14
Due: Before 11:59 PM on Tuesday,
2/18/14
Note that late homeworks will NOT
be accepted.
The Objectives
- To demonstrate that you completed Lab 1 correctly
- To practice Unix commands, including file redirection
The Assignment
The purpose of this homework is to ensure that you have completed Lab 1 correctly. Since the directory structure that you set up in that lab will be used for the rest of semester to create, organize, test and submit your homeworks and projects, it is important that you created it correctly.
This homework will test some parts of your working Linux knowledge. Note that we tell you what you must do for each step of the assignment, but not necessarily how you are to do it - that part is left up to you to figure out!
- We did not have you create enough subdirectories in Lab 1. Create additional subdirectories "hw5" through "hw8" within the "Desktop/cs104" directory.
Your next task is to create and submit a listing of the directory that will convince us you followed the instructions in Lab 1 correctly.
- First, make sure you are still in your "cs104" subdirectory
-
Next, try out the "ls -l -R" command:
linux1[4]% pwd /afs/umbc.edu/users/c/m/cmarron/home/Desktop/cs104 linux1[5]% ls -l -R .: total 23 drwxr-xr-x 2 cmarron rpc 2048 Feb 4 17:10 hw1 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw2 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw3 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw4 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw5 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw6 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw7 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 hw8 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 proj1 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 proj2 drwxr-xr-x 2 cmarron rpc 2048 Feb 11 21:38 proj3 ./hw1: total 1 -rw-r--r-- 1 cmarron rpc 7 Feb 4 17:10 mybio.txt ./hw2: total 0 ./hw3: total 0 ./hw4: total 0 ./hw5: total 0 ./hw6: total 0 ./hw7: total 0 ./hw8: total 0 ./proj1: total 0 ./proj2: total 0 ./proj3: total 0
- Now, the thing you have to figure out: how can you send the output of this command into a file? The answer is in the lecture notes on Linux and Operating Systems. DO NOT USE WINDOWS CUT-AND-PASTE to do this!!! Get the output of the "ls -l -R" command into a file called "hw1.txt" and then move the file to your "hw1" directory.
At this point, you should have two files in the "hw1" directory: "hw1.txt" and "mybio.txt" (from Lab 1). The next step is to submit these files to me for grading.
- Change to the "hw1" directory (use "pwd" to check that you
have done this correctly) and then submit the files to the
project "hw1" using the command:
linux1[6]% submit cmsc104_cmarron hw1 hw1.txt mybio.txt linux1[7]%
- You can use the "submitls" command to check that you have submitted
both files:
linux1[8]% submitls cmsc104_cmarron hw1 total 5 drwxr-xr-x 2 cmarron rpc 2048 Feb 12 14:05 . drwxr-xr-x 43 cmarron rpc 2048 Feb 12 14:05 .. -rw-r--r-- 1 cmarron rpc 2048 Feb 12 14:05 mybio.txt -rw-r--r-- 1 cmarron rpc 1858 Feb 12 14:05 hw1.txt