在Linux下创建工作目录,一般使用 “mkdir" 指令,一下将介绍“mkdir”指令的使用方法,供大家参考。

一、使用帮助

在Linux终端(命令行)输入:mkdir --help,输出如下信息:

 Usage: 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 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 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info coreutils 'mkdir invocation'

二、mkdir 各参数说明

语法:mkdir [OPTION]... DIRECTORY...

条件:要创建的目录DIRECTORY不存在,否则将会报错

参数:

  -m  设定创建目录的权限,其权限模式同 "chmod",r=4, w=2, x=1;

  -p  递归创建目录,如果子目录的父目录已存在,也不会报错;若子目录存在,也不会报错,且不会覆盖已存在的子目录中的数据文件;

  -v  逐个显示要创建的目录的信息,描述每一个新创建的目录;

  -Z  设置目录的 SELinux 安全上下文信息;

    --help  提供帮助信息;

    --version  描述版本号。

实例:

1  mkdir -m 0775 test01

2  mkdir -p /home/bin/test02

3  mkdir -v test03

4  mkdir -m 0555 -p -v /home/lbin/test/test01/test02 

    mkdir: created directory ‘/home/liupf/test/test01’
    mkdir: created directory ‘/home/liupf/test/test01/test02’

Linux 之创建工作目录-mkdir的更多相关文章

  1. Git创建工作目录与常用指令

    1.创建工作目录与常用指令 工作目录(WorkSpace)一般就是你希望Git帮助你管理的文件夹,可以是你项目的目录,也可以是一个空目录,建议不要有中文. 日常使用只要记住下图6个命令: 2.提交管理 ...

  2. 【Linux命令】工作目录切换命令(pwd,cd,ls)

    目录 pwd显示当前的工作路径 cd切换工作目录 ls显示目录中文件信息 一.pwd命令 pwd命令用于显示当前的工作路径. 格式: pwd [选项] 参数: -L,--logical,显示当前的路径 ...

  3. 利用pwdx查看Linux程序的工作目录

    Linux中的pwdx命令,利用进程号作为参数,可以打印出指定进程号的工作目录,帮助我们区分不同的进程. pwdx <pid> [hnyundev@BJ03000036 ~]$ pwd 3 ...

  4. linux 创建多级目录 mkdir -p

    原文地址:http://www.dutor.net/index.php/2010/06/cmd-mkdir-p/ mkdir的-p选项允许你一次性创建多层次的目录,而不是一次只创建单独的目录.例如,我 ...

  5. linux 打印当前工作目录

    pwd

  6. php mkdir 创建多级目录实例代码

    先介绍一下 mkdir() 这个函数 mkdir($path,0777,true); 第一个参数:必须,代表要创建的多级目录的路径. 第二个参数:设定目录的权限,默认是 0777,意味着最大可能的访问 ...

  7. Linux命令学习之路——变更工作目录:cd

    使用权限:所有角色 使用方式:cd [ targetDir ] 作用:该命令用于在Linux中切换工作目录 注意点: 1.targetDir代表目标目录,可以采用绝对路径或相对路径表示: 2.当tar ...

  8. Linux命令(十三) 建立目录 mkdir 删除目录 rmdir

    一.建立目录 mkdir 命令简介 mkdir 命令用于创建指定的目录.创建目录时当前用户对需要操作的目录有读取权限.如果目录已经存在,会提示报错并推出. mkdir 可以创建多级目录. 常用参数说明 ...

  9. PHP使用mkdir创建多级目录的方法

    PHP中使用mkdir()可以创建多级目录,相比之前自己一级一级的创建,这个函数非常好用. 下面是php手册上的函数介绍: bool mkdir ( string $pathname [, int $ ...

随机推荐

  1. 组合数(Lucas定理) + 快速幂 --- HDU 5226 Tom and matrix

    Tom and matrix Problem's Link:   http://acm.hdu.edu.cn/showproblem.php?pid=5226 Mean: 题意很简单,略. analy ...

  2. 2014 WAP校园招聘笔试题

    2014 WAP校园招聘笔试题 Problem's Link:   http://www.doc88.com/p-6751117015483.html WAP公司笔试题 We are planning ...

  3. IEnumerable接口

    IEnumerable接口顾名思义就是 可枚举的,可列举的. 接口也很简单,返回一个 枚举器对象 IEnumerator . [ComVisible(true), Guid("496B0AB ...

  4. csharp: Flash Player play *.flv file in winform

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. Ubuntu安装图形桌面

    apt-get直接更新即可 apt-get install ubuntu-desktop

  6. maven oracle jdbc jar

    1.problem describe: when your dependency jar about oracle use code like this: <!-- oracle-connect ...

  7. hibernate初步4

    JPA 1.JPA概述 JPA(Java Persistence API)是Sun官方提出的Java持久化规范.它为Java开发人员提供了一种对象/关系映射工具来管理Java应用中的关系数据.,而Hi ...

  8. CSS应用内容补充及小实例

    一.clear 清除浮动 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...

  9. swift学习笔记之-自动引用计数

    //自动引用计数 import UIKit /*自动引用计数(Automatic Reference Counting) 防止循环强引用 Swift 使用自动引用计数(ARC)机制来跟踪和管理你的应用 ...

  10. Vue中class与style绑定

    gitHub地址:https://github.com/lily1010/vue_learn/tree/master/lesson07 一 用对象的方法绑定class 很简单,举个栗子: <!D ...