Answer to Excersise 2

If you type this line to the shell you will get a result looking something like
$ rm -foo
usage: rm [-rif] file ...
The reason for this is that there are some commands that accept switches of the form -switch. As an example the following command will produce a long listing of the contents of the directory.
ls -l
There are several more commands that accept switches, rm is among them.

When you type a line to the shell, quoting will prevent any expansion done by the shell, but in this case -foo will be passed to rm, which will interpret this as a switch. There is no -o switch to rm, so rm will print an error message To solve this problem you have to type a name to rm that does not start with a -, but which still denotes the file -foo. Remembering that . denotes the current directory gives us the following line, which remove the file -foo from the current directory.

 rm ./-foo 

Matz Kindahl <>
Last modified: Thu Oct 19 16:12:34 1995