2017-06-06 66 views

回答

3

mkdir命令尝试将“-AFolder /”解释为选项,因为它以-开头。

使用--伪参数告诉明确,你是不是提供了一个选项:

mkdir -- -AFolder 

从Bash的手册页:

Unless otherwise noted, each builtin command documented in this section as accepting options preceded by - accepts -- to signify the end of the options.

+0

它的工作,谢谢 – dungphanxuan

2
mkdir -p -- "-AFolder" 

使用--告诉bash命令说以下任何事情都不是一面旗帜,它是论证的一部分。从人BAGE:

-- A -- signals the end of options and disables further option processing. Any arguments after the -- are treated as filenames and argu- ments. An argument of - is equivalent to --.

+0

谢谢你,该解决方案 – dungphanxuan

0

除了--约定mkdir支持,您还可以与./前面加上目录名。

mkdir ./-AFolder 
相关问题