Linux命令中的rmdir
来源:互联网 发布:键盘美化软件下载 编辑:程序博客网 时间:2024/05/01 13:36
rmdir命令,该命令的功能是删除空目录。一个目录删除之前必须是空的。删除目录的时候也必须具有对父目录的写权限。
命令格式:rmdir [选项] 目录
命令功能:该命令从一个目录中删除一个或者多个子目录项,删除目录的时候也必须对父目录有写权限。
命令实例:
[root@centos65 local]# cd liumengyang[root@centos65 liumengyang]# [root@centos65 liumengyang]# lltotal 0drwxr-xr-x 2 root root 6 Aug 19 08:46 hellodrwxr-xr-x 2 root root 6 Aug 19 08:46 hi[root@centos65 liumengyang]# [root@centos65 liumengyang]# [root@centos65 liumengyang]# cd ..[root@centos65 local]# [root@centos65 local]# [root@centos65 local]# [root@centos65 local]# rmdir liumengyangrmdir: failed to remove `liumengyang': Directory not empty
当目录不为空的时候,不能够删除该目录
drwxr-xr-x 2 root root 6 Sep 23 2011 bindrwxr-xr-x 2 root root 65536 Aug 19 08:52 datadrwxr-xr-x 2 root root 6 Sep 23 2011 etcdrwxr-xr-x 2 root root 6 Sep 23 2011 gamesdrwxr-xr-x 5 root root 4096 Aug 18 18:07 importsourcedrwxr-xr-x 2 root root 32 Jan 14 2015 includedrwxr-xr-x 2 root root 6 Sep 23 2011 libdrwxr-xr-x 2 root root 6 Sep 23 2011 lib64drwxr-xr-x 2 root root 6 Sep 23 2011 libexecdrwxr-xr-x 2 root root 6 Aug 19 08:53 liumengyangdrwxr-xr-x 2 root root 6 Sep 23 2011 sbindrwxr-xr-x 5 root root 46 Dec 4 2013 sharedrwxr-xr-x 3 root root 22 Aug 17 12:42 sourcedatadrwxr-xr-x 2 root root 6 Sep 23 2011 src[root@centos65 local]# cd liumengyang[root@centos65 liumengyang]# [root@centos65 liumengyang]# [root@centos65 liumengyang]# lltotal 0[root@centos65 liumengyang]# [root@centos65 liumengyang]# [root@centos65 liumengyang]# mkdir hello[root@centos65 liumengyang]# [root@centos65 liumengyang]# lltotal 0drwxr-xr-x 2 root root 6 Aug 19 08:53 hello[root@centos65 liumengyang]# [root@centos65 liumengyang]# [root@centos65 liumengyang]# cd ..[root@centos65 local]# [root@centos65 local]# [root@centos65 local]# rmdir -p liumengyang/hello[root@centos65 local]# [root@centos65 local]# [root@centos65 local]# lltotal 96drwxr-xr-x 2 root root 6 Sep 23 2011 bindrwxr-xr-x 2 root root 65536 Aug 19 08:52 datadrwxr-xr-x 2 root root 6 Sep 23 2011 etcdrwxr-xr-x 2 root root 6 Sep 23 2011 gamesdrwxr-xr-x 5 root root 4096 Aug 18 18:07 importsourcedrwxr-xr-x 2 root root 32 Jan 14 2015 includedrwxr-xr-x 2 root root 6 Sep 23 2011 libdrwxr-xr-x 2 root root 6 Sep 23 2011 lib64drwxr-xr-x 2 root root 6 Sep 23 2011 libexecdrwxr-xr-x 2 root root 6 Sep 23 2011 sbindrwxr-xr-x 5 root root 46 Dec 4 2013 sharedrwxr-xr-x 3 root root 22 Aug 17 12:42 sourcedatadrwxr-xr-x 2 root root 6 Sep 23 2011 src
rmdir -p 目录路径 当子目录删除完毕的时候,父目录变为空。则父目录也一并被删除。
0 0
- Linux命令中的rmdir
- linux命令:rmdir 命令
- Linux命令:rmdir
- linux rmdir命令
- linux命令-rmdir
- Linux命令行:rmdir命令
- Linux常用命令:rmdir 命令
- linux命令 rmdir
- linux命令大全 rmdir
- [Linux命令]--rmdir
- linux命令之rmdir
- linux命令--mkdir rmdir
- Linux 命令6-rmdir命令
- linux下的rmdir命令
- linux命令rmdir用法详解
- linux命令详解(6):rmdir
- linux常用命令(6):rmdir命令
- (6) linux shell 命令 -- rmdir
- ListView中的Item点击事件和子控件的冲突或者item点击没有反应的解决办法
- android 源码各版本下载 原生纯净版
- 二叉树中的最大路径和
- iOS UI初级-UIVew与UIWindow
- git 常用命令
- Linux命令中的rmdir
- Rectangle Area
- iOS UI初级-常用UI控件
- iOS开发中的小技巧
- linux下mysql默认安装目录和常用命令
- git 克隆远程仓库并创建分支、提交分支、获取分支
- HDU 5405 Sometimes Naive 2015多校联合训练赛#9 LCT 树链剖分
- 每天都好困的说
- 异步,线程,并行概念