IC221: Systems Programming (SP18)


Home Policy Calendar Units Assignments Resources

HW 1: Unix Basics

Instructions

  • You must turn in a sheet of paper that is neatly typed or written answering the questions below. (You are strongly encouraged to type your homework.)
  • This homework is graded out of 100 points. Point values are associated to each question.

Bonus 10 points: use Latex to format your homework

Using your Ubuntu VM, download the following template file hw.tex and fill in the \myanswer{} directives using your favorite text editor. Compile the latex in your terminal using pdflatex

$ pdflatex hw.tex

Which will produce a hw.pdf file. Turn that file in printed, in hard copy, to your instructor on the due date.

Questions

  1. (10 points) What are the three components of a Unix system? Provide an example of the interaction from a user perspective down to the hardware and back up
  2. (15 points) Consider the ls -l output below, label the output appropriately:

    drwxr-xr-x 2 aviv scs 4096 2013-12-22 10:57 demo/
    -rw-r--r-- 1 aviv scs 13454 2013-12-22 10:56 text.dat
    
  3. (15 points) For the following commands, determine in which bin directory they live by using which command on a lab machine
    1. ls
    2. which
    3. tac
    4. grep
    5. cut
    6. chmod
    7. head
    8. mv
  4. (10 points) Look up the tac command in the man pages. Describe its operations, and give an example usage.
  5. (15 points) What are the three guiding principles of the Unix design philosophy?
  6. (10 points) What are the primary purpose of standard input, output, and error for different programs?
  7. (15 points) Consider the following command line with redirects:

    grep PA < sample-db.csv 2> oops > sample-db.PA.csv
    
    1. What is the output file?
    2. What is the input file?
    3. What is the error file?
  8. (10 points) Using a pipeline as an example, why is it necessary to have standard error and standard output?