每天一个Linux命令(4):mkdir命令
mkdirmkdir [选项] 目录名mkdir mydirmkdir dir1 dir2 dir3这将在当前工作目录下同时创建名为 dir1、dir2 和 dir3 的目录。
3.
mkdir -p path/to/mydir这将递归地创建名为 mydir 的目录,并创建其上级目录 path/to(如果不存在的话)。
说明:
mkdir 命令是一个用于创建目录的常用工具。使用 mkdir 命令时,您可以指定要创建的目录名称,并可选地使用 -p 选项来递归地创建目录及其上级目录。请注意,您需要具有足够的权限才能在指定的位置创建目录。使用 mkdir 命令时,请确保提供正确的目录名和选项,以便成功创建所需的目录。
[[email protected] ~]# mkdir --helpUsage: mkdir [OPTION]... DIRECTORY...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 directoryto the default type--context[=CTX] like -Z, or if CTX is specified then set the SELinuxor SMACK security context to CTX--help display this help and exit--version output version information and exitGNU coreutils online help: <https://www.gnu.org/software/coreutils/>Full documentation <https://www.gnu.org/software/coreutils/mkdir>or available locally via: info '(coreutils) mkdir invocation'