当发现有疑难问题不好解决,man一下
#man rm之后,发现一句话:
To remove a file whose name starts with a ‘-’, for example ‘-foo’, use one of these commands:
rm -- -foo
rm ./-foo
也就是说,如果要删除一个文件 -foo ,用一般的 rm 命令是完成不了的。 rm -foo 、 rm \-foo 、 rm "-foo" 、 rm "\-foo" …… 都无法将此文件删除,只能通过 rm -- -foo 或者 rm ./-foo 的方式删除
同样此方法对于其它命令都是通用的
vi -- -c 将生成一个 -c 文件
ls -l -- -c 将显示 -c 文件
欢迎转载本文,请注明来自:http://www.linuxsense.org
TAG: linux rm 横线开头 横线
发布: 2007-10-17 15:35 作者: admin 来源: 本站原创 查看: 58次

最新评论
删除 Guest (2007-11-14 15:54:16, 评分: 1 )