How do I deal with a filename that starts with the hyphen (-) character?

后端 未结 4 1207
感情败类
感情败类 2020-11-28 08:34

Somehow, at some point, I accidentally created a file in my home directory named \'-s\'. It is about 500 kb and I have no idea if it contains important data or not. I cannot

4条回答
  •  悲&欢浪女
    2020-11-28 08:57

    You can refer to it either using ./-filename or some command will allow you to put it after double dash:

    rm -- -filename
    

提交回复
热议问题