Linux rm命令

Linux 教程 · 2019-02-14 06:59:18

Linux rm命令用于删除一个文件或者目录。

语法

rm [options] name...

参数

  • -i 删除前逐一询问确认。
  • -f 即使原档案属性设为唯读,亦直接删除,无需逐一确认。
  • -r 将目录及以下之档案亦逐一删除。

实例

删除文件可以直接使用rm命令,若删除目录则必须配合选项"-r",例如:

# rm  test.txt 
rm:是否删除 一般文件 "test.txt"? y  
# rm  homework  
rm: 无法删除目录"homework": 是一个目录  
# rm  -r  homework  
rm:是否删除 目录 "homework"? y 

删除当前目录下的所有文件及目录,命令行为:

rm  -r  * 

文件一旦通过rm命令删除,则无法恢复,所以必须格外小心地使用该命令。

点击查看所有 Linux 教程 文章: https://codercto.com/courses/l/14.html

查看所有标签

Complexity and Approximation

Complexity and Approximation

G. Ausiello、P. Crescenzi、V. Kann、Marchetti-sp、Giorgio Gambosi、Alberto M. Spaccamela / Springer / 2003-02 / USD 74.95

This book is an up-to-date documentation of the state of the art in combinatorial optimization, presenting approximate solutions of virtually all relevant classes of NP-hard optimization problems. The......一起来看看 《Complexity and Approximation》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具