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
- (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
(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
- (15 points) For the following commands, determine in which bin directory they
live by using
which
command on a lab machinels
which
tac
grep
cut
chmod
head
mv
- (10 points) Look up the tac command in the
man
pages. Describe its operations, and give an example usage. - (15 points) What are the three guiding principles of the Unix design philosophy?
- (10 points) What are the primary purpose of standard input, output, and error for different programs?
(15 points) Consider the following command line with redirects:
grep PA < sample-db.csv 2> oops > sample-db.PA.csv
- What is the output file?
- What is the input file?
- What is the error file?
- (10 points) Using a pipeline as an example, why is it necessary to have standard error and standard output?