Removing a file from a directory

How do you remove a file named '-'? ('rm' does not work)

Try the below command :

find . -type f -name "-" -exec rm {} \;

I have tried and it worked.

Try this

ls -i -

find . -inum <<<inodenumber>>> -exec rm -i {} \;

or more simply:

rm -- -

will work.

the double hyphen is useful for several commands; it basically informs that there are no more switches, but to treat the rest of input as args

i m assuming, you are trying to remove '-'
rm -rf "'-'"
and if you are trying to remove -
then
rm -rf "-"

anyone knows wat wil happen if you accidentally do "rm ~" ??
anyone here has encountered disaster?!!