(linux )怎么删除--filename这样的文件

RT
生成了一个--filename的文件,想把它删掉,但是每次都会被当成是选项无法删除。这个文件时通过tar生成的。

阅读 2.9k
2 个回答

man rm一下呗:

 To remove a file whose name starts with a '-', for example '-foo', use one of these commands:

              rm -- -foo

              rm ./-foo

执行:

➜  test ll
total 4.0K
-rw-rw-r--. 1 bob bob 1 Aug  9 09:49 --filename
➜  test man rm
➜  test rm -- --filename
➜  test ll
total 0
➜  test 

强删不行吗?rm -rf

推荐问题