Due Thursday, August 31
The following homework exercises various simple Unix/Linux utilities. Each of the questions has various subquestions. Answer all questions and subquestions. If there is an instruction that does not specifically ask a question (e.g. "Remove the file 'foo'"), then you should tell me what you did to follow that instruction. If I ask a question like "who owns the files in your directory", then you should show me a listing that demonstrates your answer.
One generally useful thing to know is how to use the manual pages. Most commands that you will encounter are described in the manual pages. If you want to figure out how to use the "date" command, for instance you would type:
man dateThis will give you a list of arguments and descriptions of their behavior. From within emacs you can type "M-x man", after which emacs will prompt you for the name of a command. In some problems in the homeworks I will assume knowledge that was not necessarily covered in the readings or in class. In that case you should resort to the man page for the command(s) in question to find out how to solve the problem.
$ ed foo <== you type foo: No such file or directory <== system responds a <== you type This is a test. <== you type . <== you type w <== you type 16 <== system responds q <== you type
What are the permissions on this file? Now make it so that nobody except you can read it or write it.
Remove the file "foo"
cd .. mkdir foo
Did it work? Why or why not?
mkdir ..What happened? Why?
S
/ \
X1 X2
/ \ | \
x3 x4 x5 x6
chmod 755 foo chmod 622 foo chmod 155 foo chmod 322 foo
Translate the following symbolic invocations of chmod into numeric equivalents:
chmod u=rwx,go=rx foo chmod u=x,go=rw foo chmod u=rw,go=r foo chmod go=r foo
For the last one, can you specify a numeric code without knowing the current setting? Why or why not?
touch foo chmod 444 foo rm fooWhy?
chmod 744 dir
Later on someone complains that they can't do
cd dir
Who messed up, them or you? Why?
Explain the means by which you found your cave.