Shell unix:以-通配符开头的文件

Shell unix:以-通配符开头的文件,shell,unix,Shell,Unix,我想要rm或cp一组具有公共扩展名的文件,其中一些文件以-开头,因此unix抱怨未知选项。我能做什么 rm*csvman rm: To remove a file whose name starts with a '-', for example '-foo', use one of these commands: rm -- -foo rm ./-foo 因此: 此外,如果名称中有一个文字星号,引用可以抑制全局搜索: rm "*cvs" 有时,使用“交互”

我想要rm或cp一组具有公共扩展名的文件,其中一些文件以
-
开头,因此unix抱怨未知选项。我能做什么

rm*csv
man rm

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

       rm -- -foo

       rm ./-foo
因此:


此外,如果名称中有一个文字星号,引用可以抑制全局搜索:

rm "*cvs"
有时,使用“交互”选项并确认要删除的文件可能会很有用:

rm -i -- *

如果文件名的键盘上有难以键入的字符,这就很方便了。

@JamesBrown那么,你期望什么呢?您没有创建名为
*test
且带有文字星号的文件,无法将其删除。
rm -i -- *