The reason for this is that there are some commands that accept switches of the form$ rm -foo usage: rm [-rif] file ...
-switch. As an example the following command will produce a long listing of the contents of the directory.
There are several more commands that accept switches,
rmis 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
rm, which will interpret this as a switch. There is no
-o switch to
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