• Ubuntu22.04桌面版的 mkdir , mkdir -p 命令笔记2221107


    Ubuntu22.04桌面版的 mkdir 命令笔记

    mkdir 用于创建文件夹

    mkdir -p 自动创建父文件夹,父文件夹存不存在都没关系, 等效 mkdir --parents

    在这里插入图片描述

    mkdir --help

    用法:mkdir [选项]… 目录…
    若指定<目录>不存在则创建目录。

    必选参数对长短选项同时适用。
    -m, --mode=模式 设置权限模式(类似chmod),而不是 a=rwx 减 umask
    -p, --parents 需要时创建目标目录的上层目录,但即使这些目录已存在
    也不当作错误处理
    -v, --verbose 每次创建新目录都显示信息
    -Z 设置每个创建的目录的 SELinux 安全上下文为默认类型
    –context[=CTX] 类似 -Z,或如果指定了 CTX,则将 SELinux 或 SMACK 安全
    上下文设置为 CTX 对应的值
    –help 显示此帮助信息并退出
    –version 显示版本信息并退出

    用法:mkdir [选项]... 目录...
    若指定<目录>不存在则创建目录。
    
    必选参数对长短选项同时适用。
      -m, --mode=模式   设置权限模式(类似chmod),而不是 a=rwx 减 umask
      -p, --parents     需要时创建目标目录的上层目录,但即使这些目录已存在
                          也不当作错误处理
      -v, --verbose     每次创建新目录都显示信息
      -Z                   设置每个创建的目录的 SELinux 安全上下文为默认类型
          --context[=CTX]  类似 -Z,或如果指定了 CTX,则将 SELinux 或 SMACK 安全
                             上下文设置为 CTX 对应的值
          --help		显示此帮助信息并退出
          --version		显示版本信息并退出
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    man mkdir
    MKDIR(1)                                                     User Commands                                                    MKDIR(1)
    
    NAME
           mkdir - make directories
    
    SYNOPSIS
           mkdir [OPTION]... DIRECTORY...
    
    DESCRIPTION
           Create the DIRECTORY(ies), if they do not already exist.
    
           Mandatory arguments to long options are mandatory for short options too.
    
           -m, --mode=MODE
                  set file mode (as in chmod), not a=rwx - umask
    
           -p, --parents
                  no error if existing, make parent directories as needed
    
           -v, --verbose
                  print a message for each created directory
    
           -Z     set SELinux security context of each created directory to the default type
    
           --context[=CTX]
                  like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
    
           --help display this help and exit
    
           --version
                  output version information and exit
    
    AUTHOR
           Written by David MacKenzie.
    
    REPORTING BUGS
           GNU coreutils online help: 
           Report any translation bugs to 
    
    COPYRIGHT
           Copyright  ©  2020  Free  Software  Foundation,  Inc.   License  GPLv3+:  GNU  GPL  version  3  or  later  .
           This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.
    
    SEE ALSO
           mkdir(2)
    
           Full documentation 
           or available locally via: info '(coreutils) mkdir invocation'
    
    GNU coreutils 8.32                                           February 2022                                                    MKDIR(1)
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52

    MKDIR(1) User Commands MKDIR(1)

    NAME
    mkdir - make directories

    SYNOPSIS
    mkdir [OPTION]… DIRECTORY…

    DESCRIPTION
    Create the DIRECTORY(ies), if they do not already exist.

       Mandatory arguments to long options are mandatory for short options too.
    
       -m, --mode=MODE
              set file mode (as in chmod), not a=rwx - umask
    
       -p, --parents
              no error if existing, make parent directories as needed
    
       -v, --verbose
              print a message for each created directory
    
       -Z     set SELinux security context of each created directory to the default type
    
       --context[=CTX]
              like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
    
       --help display this help and exit
    
       --version
              output version information and exit
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    AUTHOR
    Written by David MacKenzie.

    REPORTING BUGS
    GNU coreutils online help: https://www.gnu.org/software/coreutils/
    Report any translation bugs to https://translationproject.org/team/

    COPYRIGHT
    Copyright © 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later censes/gpl.html>.
    This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

    SEE ALSO
    mkdir(2)

       Full documentation 
       or available locally via: info '(coreutils) mkdir invocation'
    
    • 1
    • 2

    GNU coreutils 8.32 February 2022 MKDIR(1)

    info mkdir
    File: coreutils.info,  Node: mkdir invocation,  Next: mkfifo invocation,  Prev: ln invocation,  Up: Special file types
    
    12.3 ‘mkdir’: Make directories
    ==============================
    
    ‘mkdir’ creates directories with the specified names.  Synopsis:
    
         mkdir [OPTION]... NAME...
    
       ‘mkdir’ creates each directory NAME in the order given.  It reports
    an error if NAME already exists, unless the ‘-p’ option is given and
    NAME is a directory.
    
       The program accepts the following options.  Also see *note Common
    options::.
    
    ‘-m MODE’
    ‘--mode=MODE’
         Set the file permission bits of created directories to MODE, which
         uses the same syntax as in ‘chmod’ and uses ‘a=rwx’ (read, write
         and execute allowed for everyone) for the point of the departure.
         *Note File permissions::.
    
         Normally the directory has the desired file mode bits at the moment
         it is created.  As a GNU extension, MODE may also mention special
         mode bits, but in this case there may be a temporary window during
         which the directory exists but its special mode bits are incorrect.
         *Note Directory Setuid and Setgid::, for how the set-user-ID and
         set-group-ID bits of directories are inherited unless overridden in
         this way.
    
    ‘-p’
    ‘--parents’
         Make any missing parent directories for each argument, setting
         their file permission bits to the umask modified by ‘u+wx’.  Ignore
         existing parent directories, and do not change their file
         permission bits.
    
         To set the file permission bits of any newly-created parent
         directories to a value that includes ‘u+wx’, you can set the umask
         before invoking ‘mkdir’.  For example, if the shell command ‘(umask
         u=rwx,go=rx; mkdir -p P/Q)’ creates the parent ‘P’ it sets the
         parent’s permission bits to ‘u=rwx,go=rx’.  To set a parent’s
         special mode bits as well, you can invoke ‘chmod’ after ‘mkdir’.
         *Note Directory Setuid and Setgid::, for how the set-user-ID and
         set-group-ID bits of newly-created parent directories are
         inherited.
    
    ‘-v’
    ‘--verbose’
         Print a message for each created directory.  This is most useful
         with ‘--parents’.
    
    ‘-Z’
    ‘--context[=CONTEXT]’
         Without a specified CONTEXT, adjust the SELinux security context
         according to the system default type for destination files,
         similarly to the ‘restorecon’ command.  The long form of this
         option with a specific context specified, will set the context for
         newly created files only.  With a specified context, if both
         SELinux and SMACK are disabled, a warning is issued.
    
       An exit status of zero indicates success, and a nonzero value
    indicates failure.
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66

    File: coreutils.info, Node: mkdir invocation, Next: mkfifo invocation, Prev: ln invocation, Up: Special file types

    12.3 ‘mkdir’: Make directories

    ‘mkdir’ creates directories with the specified names. Synopsis:

     mkdir [OPTION]... NAME...
    
    • 1

    ‘mkdir’ creates each directory NAME in the order given. It reports
    an error if NAME already exists, unless the ‘-p’ option is given and
    NAME is a directory.

    The program accepts the following options. Also see *note Common
    options::.

    ‘-m MODE’
    ‘–mode=MODE’
    Set the file permission bits of created directories to MODE, which
    uses the same syntax as in ‘chmod’ and uses ‘a=rwx’ (read, write
    and execute allowed for everyone) for the point of the departure.
    *Note File permissions::.

     Normally the directory has the desired file mode bits at the moment
     it is created.  As a GNU extension, MODE may also mention special
     mode bits, but in this case there may be a temporary window during
     which the directory exists but its special mode bits are incorrect.
     *Note Directory Setuid and Setgid::, for how the set-user-ID and
     set-group-ID bits of directories are inherited unless overridden in
     this way.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    ‘-p’
    ‘–parents’
    Make any missing parent directories for each argument, setting
    their file permission bits to the umask modified by ‘u+wx’. Ignore
    existing parent directories, and do not change their file
    permission bits.

     To set the file permission bits of any newly-created parent
     directories to a value that includes ‘u+wx’, you can set the umask
     before invoking ‘mkdir’.  For example, if the shell command ‘(umask
     u=rwx,go=rx; mkdir -p P/Q)’ creates the parent ‘P’ it sets the
     parent’s permission bits to ‘u=rwx,go=rx’.  To set a parent’s
     special mode bits as well, you can invoke ‘chmod’ after ‘mkdir’.
     *Note Directory Setuid and Setgid::, for how the set-user-ID and
     set-group-ID bits of newly-created parent directories are
     inherited.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    ‘-v’
    ‘–verbose’
    Print a message for each created directory. This is most useful
    with ‘–parents’.

    ‘-Z’
    ‘–context[=CONTEXT]’
    Without a specified CONTEXT, adjust the SELinux security context
    according to the system default type for destination files,
    similarly to the ‘restorecon’ command. The long form of this
    option with a specific context specified, will set the context for
    newly created files only. With a specified context, if both
    SELinux and SMACK are disabled, a warning is issued.

    An exit status of zero indicates success, and a nonzero value
    indicates failure.

  • 相关阅读:
    2022亚太B题赛题分享
    传智杯#5练习赛_树的变迁
    IBM MQ 通道数量查看,以及最大通道数的修改
    【leetcode刷题之路】面试经典hot100(1)——哈希+双指针+滑动窗口+子串
    箭头函数写法
    生产管理:模具管理系统
    啃完朋友分享给我的《Linux全解笔记》我都不敢说我懂linux了
    英语——分享篇——每日200词——2201-2400
    web前端面试高频考点——Vue原理(理解MVVM模型、深度/监听data变化、监听数组变化、深入了解虚拟DOM)
    【kali-信息收集】(1.4)识别活跃的主机/查看打开的端口:Nmap(网络映射器工具)
  • 原文地址:https://blog.csdn.net/kfepiza/article/details/127729361