【发布时间】:2014-10-12 11:50:32
【问题描述】:
我需要创建目录层次结构,但我只能使用 1 个命令,我该如何执行以下操作?
我目前在名为“linux”的目录中,现在我必须在这里创建一个名为“a”的目录,并在此目录中创建一个名为“b”的目录。
thnx
【问题讨论】:
我需要创建目录层次结构,但我只能使用 1 个命令,我该如何执行以下操作?
我目前在名为“linux”的目录中,现在我必须在这里创建一个名为“a”的目录,并在此目录中创建一个名为“b”的目录。
thnx
【问题讨论】:
你可以试试:
mkdir --parents a/b
【讨论】:
mkdir -p a/b/c/d
-p Create intermediate directories as required. If this option is not specified, the full path prefix of
each operand must already exist. On the other hand, with this option specified, no error will be
reported if a directory given as an operand already exists. Intermediate directories are created with
permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permission
for the owner.
【讨论】: