Unable to remove a file which have a name like a command argument

Posted by Justin on Ask Ubuntu See other posts from Ask Ubuntu or by Justin
Published on 2014-06-12T08:47:04Z Indexed on 2014/06/12 9:41 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

By inadvertance, I've created a file called -r into my home directory.

Please don't ask me how and why, I don't recall.

But the fact is that now I cannot get rid of it :

rm -rf
rm: missing operand
Try 'rm --help' for more information.

Other try :

rm /-/r
rm: cannot remove ‘/-/r’: No such file or directory

Another one :

rm \-r
rm: missing operand
Try 'rm --help' for more information.

Is there a way to remove this file without deleting the whole directory ?

Thanks.

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about server