【问题标题】:linux mkdir directory in directorylinux mkdir 目录中的目录
【发布时间】:2014-10-12 11:50:32
【问题描述】:

我需要创建目录层次结构,但我只能使用 1 个命令,我该如何执行以下操作?

我目前在名为“linux”的目录中,现在我必须在这里创建一个名为“a”的目录,并在此目录中创建一个名为“b”的目录。

thnx

【问题讨论】:

    标签: linux mkdir


    【解决方案1】:

    你可以试试:

    mkdir --parents a/b
    

    【讨论】:

      【解决方案2】:
      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.
      

      【讨论】:

        猜你喜欢
        • 2012-08-21
        • 2011-08-26
        • 2010-10-20
        • 1970-01-01
        • 1970-01-01
        • 2011-11-27
        • 1970-01-01
        • 2011-01-28
        • 1970-01-01
        相关资源
        最近更新 更多