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
  • 相关阅读:
    用简单的方法解决问题
    记一次调试
    工作笔记还是蛮有用
    35岁往上做什么
    2013年个人总结
    一个C++宏定义与枚举定义重复的编译错误
    动态库的麻烦之处
    谈谈软件项目的dependency
    创建pathing jar
    谈谈patch strategy
  • 原文地址:https://www.cnblogs.com/gundan/p/8056542.html
Copyright © 2011-2022 走看看