Have you ever accidentally created a file beginning with '-'?
It happens often by mistake and from the first look it seems
like you can't delete the file (rm thinks the initial - is an
option, and doesn't recognize the file).
The simple, quick way around this is the -- option to rm.
Say you had the file ---hey in the current directory:
$ ls ---hey
/bin/ls: unrecognized option `---hey'
Try `/bin/ls --help' for more information.
$ ls|grep hey
$ rm ---hey
rm: unrecognized option `---hey'
Try `rm --help' for more information.
$ rm -- ---hey
( ls also has an -- option: )
$ ls -- ---hey
/bin/ls: ---hey: No such file or directory
This tip generously supported by: email@example.com NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into