zoukankan      html  css  js  c++  java
  • Linux 常用命令四 rmdir rm

    一、rmdir命令

    用于删除空目录:

    wang@wang:~/workpalce/python$ tree
    .
    ├── 1.txt
    ├── 2.txt
    ├── 3.txt
    ├── A
    │   └── B
    │       └── C
    │           └── D
    │               └── E
    └── B
    
    6 directories, 3 files
    wang@wang:~/workpalce/python$ rmdir B
    wang@wang:~/workpalce/python$ tree
    .
    ├── 1.txt
    ├── 2.txt
    ├── 3.txt
    └── A
        └── B
            └── C
                └── D
                    └── E
    
    5 directories, 3 files

    二、rm命令

    删除文件:

    wang@wang:~/workpalce/python$ tree
    .
    ├── 1.txt
    ├── 2.txt
    ├── 3.txt
    └── A
        └── B
            └── C
                └── D
                    └── E
    
    5 directories, 3 files
    wang@wang:~/workpalce/python$ rm 1.txt 
    wang@wang:~/workpalce/python$ tree
    .
    ├── 2.txt
    ├── 3.txt
    └── A
        └── B
            └── C
                └── D
                    └── E
    
    5 directories, 2 files

    删除有内容的目录:

    wang@wang:~/workpalce/python$ tree
    .
    ├── 2.txt
    ├── 3.txt
    └── A
        └── B
            └── C
                └── D
                    └── E
    
    5 directories, 2 files
    wang@wang:~/workpalce/python$ rm A -r
    wang@wang:~/workpalce/python$ tree
    .
    ├── 2.txt
    └── 3.txt
    
    0 directories, 2 files
  • 相关阅读:
    python内置模块collections介绍
    Python的set集合详解
    不同 Python 数据类型的搜寻
    Python 分支、循环、条件与枚举
    ssrf爆破mysql
    php反序列化
    thinkphp历史漏洞
    Thinkphp 缓存RCE
    绕WAF文章收集
    mssql手工盲注
  • 原文地址:https://www.cnblogs.com/gundan/p/8056542.html
Copyright © 2011-2022 走看看