BCS 215 (Unix Operating Systems)
Exam #1:   2018 March 6th

In your home directory /home/students/yourid/ (where "yourid" is YOUR login name) create a subdirectory named "exam1" and do all work in ~yourid/exam1/.

To allow this exam to be graded, make sure that permission modes for these directories (750 or 755) allow members of the "students" group to read or search for file names.

  1. The following text files are in my sub directory which is also named "exam1/", i.e. ~martinb/exam1/: In your own ~/exam1/ directory, create a hard link to each of these four text files.

  2. Do the following in your exam1/ directory:

  3. The home directories for everyone in our group are contained in "/home/students/" (which is also "../../" when "exam1/" is your working directory).
    Create and enter one-line commands to do the following:

  4. In "exam1/", create five subdirectories named d0, d1, d2, and d3; set permissions on these subdirectories as follows:

  5. In "exam1/", create three empty files named a, b, and c, and set file permissions on these files as follows:

  6. More links:

  7. Use the cmd "ls -l d2" to view the names of all visible files in d2/ and display the results.
    Then, repeat the command and redirect its output to a file named "d2names".
    Enter a command line to remove the d2/ directory, then create a file named "d2error" containing a sentence that says what happened and why.

  8. The grep command extracts all lines of a file that match a pattern. Create and enter one-line commands to do the fillowing:

  9. Edit your sorted copy ("tt") to make the following changes to the text:

  10. Use the "diff" and "comm -12" commands to compare the two files "ss" and "tt": The command "cut -f1" extracts only the first column of a file.

When you are all done, save the command-line history onto a file named "h".
(Hint:   Use the history command and redirect stdout.)
Make a copy of h in d1. Create a hard link in d2 to the copy of h in d1.



BCS 215 (Unix Operating Systems)
Exam #2:   Due 2018 March 9th (by 10pm Friday)

In your home directory /home/students/yourid/ (where "yourid" is YOUR login name) create a subdirectory named "redo2" and re-do all of the above in ~yourid/redo2/.

You may use anything in ~yourid/exam1/, but DO NOT MODIFY anything in exam1/ after 3pm Tuesday 3/6.