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
  • 相关阅读:
    115. 不同的子序列
    114. 二叉树展开为链表
    基于Docker结合Canal实现MySQL实时增量数据传输
    Docker-Compose
    Docker容器的创建、启动、和停止
    ES集群
    ES
    Docker配置JDK1.8镜像
    Docker及Docker-Compose的使用
    docker安装jdk
  • 原文地址:https://www.cnblogs.com/gundan/p/8056542.html
Copyright © 2011-2022 走看看