Linux 常用命令3-- 目录操作rmdir 和 rm
2016-02-28 17:49
666 查看
rmdir 删除文件或目录 全称: Remove Directory
使用方式 : rmdir [-p] 目录名称
参数:
-p:递归的删除目录(目录必须为空)
rm 删除文件或目录 全称: Remove
使用方式 : rm [-pr] 目录名称
参数:
-f:忽略不存在的文件,不出先警告信息
-i:互动模式,在删除前询问是否操作
-r:递归删除,常用在目录删除,相当危险
使用方式 : rmdir [-p] 目录名称
参数:
-p:递归的删除目录(目录必须为空)
[root@localhost mail]# rmdir --help Usage: rmdir [OPTION]... DIRECTORY... Remove the DIRECTORY(ies), if they are empty. --ignore-fail-on-non-empty ignore each failure that is solely because a directory is non-empty -p, --parents remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a' -v, --verbose output a diagnostic for every directory processed --help display this help and exit --version output version information and exit
rm 删除文件或目录 全称: Remove
使用方式 : rm [-pr] 目录名称
参数:
-f:忽略不存在的文件,不出先警告信息
-i:互动模式,在删除前询问是否操作
-r:递归删除,常用在目录删除,相当危险
[root@localhost mail]# rm --help Usage: rm [OPTION]... FILE... Remove (unlink) the FILE(s). -f, --force ignore nonexistent files, never prompt -i prompt before every removal -I prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving protection against most mistakes --interactive[=WHEN] prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, prompt always --one-file-system when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument --no-preserve-root do not treat `/' specially --preserve-root do not remove `/' (default) -r, -R, --recursive remove directories and their contents recursively -v, --verbose explain what is being done --help display this help and exit --version output version information and exit By default, rm does not remove directories. Use the --recursive (-r or -R) option to remove each listed directory, too, along with all of its contents. To remove a file whose name starts with a `-', for example `-foo', use one of these commands: rm -- -foo rm ./-foo Note that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred.
相关文章推荐
- Linux 常用命令2——目录操作cd,pwd,mkdir
- 删除CentOS / RHEL的库和配置文件(Repositories and configuraiton files)
- Linux安装及配置vsftpd
- Linux下activeMQ安装
- Linux RPM命令
- Linux centos PXE无人值守安装 DHCP+TFTP+FTP+Kickstart
- linux内网嗅探,监控局域网内记录
- Linux内核分析课程笔记(一)
- Linux入门(二)SecureCRT之rz:command not found
- 安装或更新CentOS6.7平台的网卡驱动程序
- 腾讯云CentOS 安装MediaWiki
- Linux设备驱动模型 SPI之一
- Linux精讲——增加和删除用户
- hadoop在linux上的配置
- 配置CENTOS YUM更新源
- Linux 常用命令1——ls
- Linux sudo 命令详解
- CentOS yum 源的配置与使用
- Linux精讲——增加和删除用户组
- windows系统下安装ubuntu的方法