[转]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]# ...
随机推荐
- Windows 7 改造
1.界面改造 1.1 软件 Wallpaper Engine 收费(18¥) 动态桌面,通过steam安装,使用steam中的创意工坊下载内容 最好使用集成显卡运行,单显卡方案容易桌面异常刷新 Clo ...
- 十分钟搞定 pandas
原文:http://pandas.pydata.org/pandas-docs/stable/10min.html 译者:ChaoSimple 校对:飞龙 官方网站上<10 Minutes to ...
- 部署Qt应用时候报错0xc000007b
情况: 在开发环境可以运行,部署到其他电脑无法运行: 排错:百度.谷歌了很多方法不行,后来发现添加了Qt\5.11.0\mingw53_32\bin环境变量,程序执行正常,去掉就报错:猜测估计是dll ...
- [C# 基础知识系列]专题四:事件揭秘 (转载)
引言: 前面几个专题对委托进行了详细的介绍的,然后我们在编写代码过程中经常会听到“事件”这个概念的,尤其是写UI的时候,当我们点击一个按钮后VS就会自动帮我们生成一些后台的代码,然后我们就只需要在Cl ...
- 使用axios获取本地json数据
1. 通过搜索 网上说不放在static文件夹中会报错 但是一直报错 放到根目录下的时候不报错了 2. 在main.js中引入axios import axios from 'axios' 3. ...
- Linux 环境下安装Mysql的步骤
一,以linux cent 6.9 安装mysql 5.6.39为例#下载安装包wget --no-check-certificate https://dev.mysql.com/get/Downlo ...
- 2018 CCPC 网络赛 Buy and Resell
The Power Cube is used as a stash of Exotic Power. There are n cities numbered 1,2,…,n where allowed ...
- Multiple plot function
From: http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/ library(ggplot2) multi ...
- Convolutional Neural Network Architectures for Matching Natural Language Sentences
interaction n. 互动;一起活动;合作;互相影响 capture vt.俘获;夺取;夺得;引起(注意.想像.兴趣)n.捕获;占领;捕获物;[计算机]捕捉 hence adv. 从此;因 ...
- node.js一行一行的获取txt文件内容
node.js一行一行获取text文件代码: const readline = require('readline');//Readline是Node.js里实现标准输入输出的封装好的模块,通过这个模 ...