[英]Can't create a folder/subfolder with mkdir from home
I would like to create a folder called hello
and a sub folder located inside hello
called world
. 我想创建一个名为
hello
的文件夹和一个位于hello
内部的名为world
的子文件夹。 I've tried mkdir $HOME/hello/world
but it does not work saying that it cannot create directory since no such file or directory exists. 我已经尝试了
mkdir $HOME/hello/world
但是由于没有这样的文件或目录而无法创建目录,因此无法正常工作。 If I try $HOME/hello
I am able to create a folder called hello
inside $HOME
. 如果尝试
$HOME/hello
可以在$HOME
内创建一个名为hello
的文件夹。 How do I go about doing this? 我该怎么做呢? I do not want to use
-p
to create the needed parent folders if they are missing. 如果它们缺少,我不想使用
-p
创建所需的父文件夹。
我不确定您为什么不想对mkdir
使用-p
标志,但是如果您坚持要这样做,可以这样做:
mkdir $HOME/hello $HOME/hello/world
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.