每天一命令(3) mkdir (make directories) 1分钟
来源:互联网 发布:如何删除win10网络共享 编辑:程序博客网 时间:2024/06/06 02:27
mkdir (make directories)
man mkdir 查看命令使用
命令描述
NAME mkdir - make directoriesSYNOPSIS 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, --context=CTX set the SELinux security context of each created directory to CTX --help display this help and exit --version output version information and exit
创建单个目录mkdir html
[root@guofeng ~]# mkdir html[root@guofeng ~]# lltotal 68-rw-------. 1 root root 2404 Nov 8 2014 anaconda-ks.cfg-rw-r--r-- 1 root root 0 Jun 6 18:47 b-ba-c.txt-rw-r--r-- 1 root root 479 Jun 7 06:44 dump.rdb-rw-r--r-- 1 root root 0 May 17 07:00 EOFdrwxr-xr-x 2 root root 4096 Jun 7 18:04 html-rw-r--r--. 1 root root 39004 Nov 8 2014 install.log-rw-r--r--. 1 root root 9154 Nov 8 2014 install.log.syslog
创建多个目录 mkdir index css images
[root@guofeng ~]# mkdir index css images[root@guofeng ~]# lltotal 80-rw-------. 1 root root 2404 Nov 8 2014 anaconda-ks.cfg-rw-r--r-- 1 root root 0 Jun 6 18:47 b-ba-c.txtdrwxr-xr-x 2 root root 4096 Jun 7 18:05 css-rw-r--r-- 1 root root 479 Jun 7 06:44 dump.rdb-rw-r--r-- 1 root root 0 May 17 07:00 EOFdrwxr-xr-x 2 root root 4096 Jun 7 18:04 htmldrwxr-xr-x 2 root root 4096 Jun 7 18:05 imagesdrwxr-xr-x 2 root root 4096 Jun 7 18:05 index-rw-r--r--. 1 root root 39004 Nov 8 2014 install.log-rw-r--r--. 1 root root 9154 Nov 8 2014 install.log.syslog
创建多个目录第二种方式 mkdir {js,common,plugin}
[root@guofeng ~]# mkdir {js,common,plugin}[root@guofeng ~]# lltotal 92-rw-------. 1 root root 2404 Nov 8 2014 anaconda-ks.cfg-rw-r--r-- 1 root root 0 Jun 6 18:47 b-ba-c.txtdrwxr-xr-x 2 root root 4096 Jun 7 18:05 commondrwxr-xr-x 2 root root 4096 Jun 7 18:05 css-rw-r--r-- 1 root root 479 Jun 7 06:44 dump.rdb-rw-r--r-- 1 root root 0 May 17 07:00 EOFdrwxr-xr-x 2 root root 4096 Jun 7 18:04 htmldrwxr-xr-x 2 root root 4096 Jun 7 18:05 imagesdrwxr-xr-x 2 root root 4096 Jun 7 18:05 index-rw-r--r--. 1 root root 39004 Nov 8 2014 install.log-rw-r--r--. 1 root root 9154 Nov 8 2014 install.log.syslogdrwxr-xr-x 2 root root 4096 Jun 7 18:05 jsdrwxr-xr-x 2 root root 4096 Jun 7 18:05 plugin
创建多层级目录 mkdir -p /web/static/html/css
[root@guofeng ~]# mkdir -p /web/static/html/css[root@guofeng /]# cd web[root@guofeng web]# lltotal 4drwxr-xr-x 3 root root 4096 Jun 7 18:13 static[root@guofeng web]# cd static/[root@guofeng static]# lltotal 4drwxr-xr-x 3 root root 4096 Jun 7 18:13 html[root@guofeng static]# cd html[root@guofeng html]# lltotal 4drwxr-xr-x 2 root root 4096 Jun 7 18:13 css[root@guofeng html]# cd ss-bash: cd: ss: No such file or directory[root@guofeng html]# cd css[root@guofeng css]#
创建文件,显示创建过程mkdir -pv htm/index/css
[root@guofeng ~]# mkdir -pv htm/index/cssmkdir: created directory `htm'mkdir: created directory `htm/index'mkdir: created directory `htm/index/css'[root@guofeng ~]#
创建目录并且设置访问权限 mkdir -m 777 test
[root@guofeng ~]# mkdir -m 777 test[root@guofeng ~]# lltotal 96-rw-------. 1 root root 2404 Nov 8 2014 anaconda-ks.cfg-rw-r--r-- 1 root root 0 Jun 6 18:47 b-ba-c.txtdrwxr-xr-x 2 root root 4096 Jun 7 18:05 commondrwxr-xr-x 2 root root 4096 Jun 7 18:05 css-rw-r--r-- 1 root root 479 Jun 7 06:44 dump.rdb-rw-r--r-- 1 root root 0 May 17 07:00 EOFdrwxr-xr-x 3 root root 4096 Jun 7 18:18 htmdrwxr-xr-x 2 root root 4096 Jun 7 18:05 imagesdrwxr-xr-x 2 root root 4096 Jun 7 18:05 index-rw-r--r--. 1 root root 39004 Nov 8 2014 install.log-rw-r--r--. 1 root root 9154 Nov 8 2014 install.log.syslogdrwxr-xr-x 2 root root 4096 Jun 7 18:05 jsdrwxr-xr-x 2 root root 4096 Jun 7 18:05 plugindrwxrwxrwx 2 root root 4096 Jun 7 18:22 test[root@guofeng ~]#
0 0
- 每天一命令(3) mkdir (make directories) 1分钟
- 每天一命令(4) rmdir (remove empty directories) 1分钟
- 每天一命令(5) rm (remove files or directories) 1分钟
- mkdir - make directories
- 每天一命令(7)cp (copy files and directories)
- 每天五分钟linux(4)-mkdir
- 每天一个Linux命令-----mkdir
- 每天一个Linux命令:mkdir
- 每天一个常用的linux命令(3)--mkdir
- lLinux命令-4:mkdir(Make Directory)命令
- 每日一Linux命令(1):mkdir
- 每天一条Linux命令 mkdir命令(10)
- 每天一个linux命令:mkdir命令
- 每天一个linux命令:mkdir命令
- 每天一条linux命令 mkdir命令
- 每天一个linux命令:mkdir命令
- 一天一命令,天天五分钟(cd, pwd, mkdir, rmdir命令用法)
- 每天一命令(6)touch (change file timestamps)1分钟
- 升级系统后,使用CocoaPod出现-bash: pod: command not found 解决办法
- 跨域的理解与实现
- 【Linux学习】配置环境:实现【Vir…
- jsp中获得的路径的方法
- STM32的Systick定时器
- 每天一命令(3) mkdir (make directories) 1分钟
- Fedora23 - Broadcom not seeing specific wifi [sees others]
- IT相关网址收藏
- Android中的 Handler
- 1.InetAddress和InetSocketAddress
- IPv4与IPv6的区别是什么?
- vc++ 项目编程
- 数据库_ PL/SQL 怎么判断两个结果集是否相等
- 理解android与服务器交互