[转]Linux 基本操作(RM 删除)
来自:http://billie66.github.io/TLCL/book/chap05.html
Be Careful With rm!
小心 rm!
Unix-like operating systems such as Linux do not have an undelete command. Once you delete something with rm, it’s gone. Linux assumes you’re smart and you know what you’re doing.
类 Unix 的操作系统,比如说 Linux,没有复原命令。一旦你用 rm 删除了一些东西, 它就消失了。Linux 假定你很聪明,你知道你在做什么。
Be particularly careful with wildcards. Consider this classic example. Let’s say you want to delete just the HTML files in a directory. To do this, you type:
尤其要小心通配符。思考一下这个经典的例子。假如说,你只想删除一个目录中的 HTML 文件。输入:
rm *.html
which is correct, but if you accidentally place a space between the “*” and the “.html” like so:
这是正确的,如果你不小心在 “*” 和 “.html” 之间多输入了一个空格,就像这样:
rm * .html
the rm command will delete all the files in the directory and then complain that there is no file called “.html”.
这个 rm 命令会删除目录中的所有文件,还会抱怨没有文件叫做 “.html”。
Here is a useful tip. Whenever you use wildcards with rm (besides carefully checking your typing!), test the wildcard first with ls. This will let you see the files that will be deleted. Then press the up arrow key to recall the command and replace the ls with rm.
小贴士。 当你使用带有通配符的rm命令时(除了仔细检查输入的内容外), 先用 ls 命令来测试通配符。这会让你看到将要被删除的文件是什么。然后按下上箭头按键,重新调用 刚刚执行的命令,用 rm 替换 ls。
[转]Linux 基本操作(RM 删除)的更多相关文章
- Linux 命令 - rm: 删除文件和目录
命令格式 rm [OPTION]... FILE... 命令参数 -f, --force 强制删除,忽略不存在的文件,不会提示. -i, --interactive 没次删除文件时,提示用户确认. - ...
- linux误用rm删除文件后恢复
linux 系统:ubuntu16.04 误把/usr/local local文件删除了,要疯 步骤: 1.对于文件系统为ext3文件系统 sudo apt-get install ext3grep ...
- 【改造Linux命令之rm - 删除文件或目录-】
用途说明 rm命令是常用的命令,用来删除文件或目录(remove files or directories).它也是一个危险的命令,使用的时候要特别当心,尤其对于新手,否则整个系统就会毁在这个命令(比 ...
- Linux下用rm删除的文件的恢复方法
Linux下用rm删除的文件的恢复方法_Linux教程_Linux公社-Linux系统门户网站https://www.linuxidc.com/Linux/2008-08/14744.htm linu ...
- Linux rm 删除指定文件外的其他文件 方法汇总
一.Linux下删除文件和文件夹常用命令如下: 删除文件: rm file 删除文件夹: rm -rf dir 需要注意的是, rmdir 只能够删除 空文件夹 . 二.删除制定文件(夹)之外的所有文 ...
- Linux rm删除文件未释放空间问题分析
问题描述: 在自己的虚拟机上做实验时出现空间不足情况,检查发现之前的kafka集群测试日志在几天写了 25G,于是进入 /data/kafka01/logs 目录执行 “rm -rf *” 删除所有测 ...
- Linux文件系统之删除文件、文件夹(rm,rmdir)
rm命令,rmdir命令 rm命令Remove,功能:1)删除目录,2)删除文件. (可以递归的删除指定目录的所有文件及子目录) 注意:rm是一个危险的命令,使用的时候要特别当心,尤其对于初学者来说 ...
- Linux rm删除大批量文件
在使用rm删除大批量文件时,有可能会遭遇"参数列太长"(Argument list too long)的问题.如下所示 [oracle@DB-Server bdump]$ rm - ...
- Linux rm 删除文件
rm 删除文件rm -f 强制删除-i 提示-r 删除目录的时候-v 可实话 rm -rfv 多目录 不提示 [root@wang whp]# touch .txt [root@wang whp]# ...
随机推荐
- bootstrap-edittable 使用笔记之 (select, data,text, number)
可编辑列表的数据格式可以指定,常用的有select, data, text, number.代码如下. 前端代码: <table id="tb_product" class= ...
- JAVA对mongodb的基本操作
public class test3 { //连接数据库(不需要验证,用于测试连接本地的mongodb) public static MongoDatabase getDatabase(String ...
- 查看python中模块的所有方法
查看python中模块的所有方法 安装的python模块,现将查看方法总结如下 一.CMD命令行下使用pydoc命令 在命令行下运行$ pydoc modules即可查看 二.在python交 ...
- react react-native 日期插件 m-date-picker / rmc-date-picker的使用
m-date-picker 基于 React,提供了 iOS 风格的日期选择方式,与原生 Datepicker 非常相似. 主页: https://github.com/react-component ...
- 用PHP判断是否闰年(正则匹配法)
<?php /** * PHP判断是否闰年 */ $year="2004-02-29"; $pattern='/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0 ...
- Java并发编程75道面试题及答案
1.在java中守护线程和本地线程区别? java中的线程分为两种:守护线程(Daemon)和用户线程(User). 任何线程都可以设置为守护线程和用户线程,通过方法Thread.setDaemon( ...
- Spring Boot Logback日志配置
logback的使用: Logback的默认配置 如果配置文件 logback-test.xml 和 logback.xml 都不存在,那么 logback 默认地会调用BasicConfigurat ...
- yaf twig配置
1.安装 TWIG composer require twig/twig2.COMPOSER自动加载的引用修改 BOOTSTRAP.PHP 增加 public function _initAutolo ...
- LeetCode 104. Maximum Depth of Binary Tree C++ 解题报告
104. Maximum Depth of Binary Tree -- Easy 方法 使用递归 /** * Definition for a binary tree node. * struct ...
- 2018-2019-2 20165313 Exp3 免杀原理与实践
实践内容(3.5分) 1.1 正确使用msf编码器,msfvenom生成如jar之类的其他文件,veil-evasion,自己利用shellcode编程等免杀工具或技巧:(1.5分) 1.2 通过组合 ...