Linux 常用命令三 touch mkdir

一、touch命令

创建一个文件:

wang@wang:~/workpalce/python$ ls
wang@wang:~/workpalce/python$ touch 1.txt
wang@wang:~/workpalce/python$ ls
1.txt

创建多个文件:

wang@wang:~/workpalce/python$ touch 1.txt 2.txt 3.txt
wang@wang:~/workpalce/python$ ls
1.txt  2.txt  3.txt

二、mkdir命令

创建单级目录:

wang@wang:~/workpalce/python$ mkdir A
wang@wang:~/workpalce/python$ ls
1.txt  2.txt  3.txt  A

创建多级目录:

wang@wang:~/workpalce/python$ mkdir A/B/C/D/E -p
wang@wang:~/workpalce/python$ tree
.
├── 1.txt
├── 2.txt
├── 3.txt
└── A
    └── B
        └── C
            └── D
                └── E

5 directories, 3 files

-p 选项是指定递归创建目录

posted @ 2017-12-18 10:48  魂~  阅读(196)  评论(0编辑  收藏  举报