RM_Idioms
RMI远程方法调用讲解教程
RMI是远程方法调用的简称,象其名称暗示的那样,它能够帮助我们查找并执行远程对象的方法。
通俗地说,远程调用就象将一个class放在A机器上,然后在B机器中调用这个class的方法。
我个人认为,尽管RMI不是唯一的企业级远程对象访问方案,但它却是最容易实现的。
与能够使不同编程语言开发的CORBA不同的是,RMI是一种纯Java 解决方案。
在RMI中,程序的所有部分都由Java编写。
在看本篇文章时,我假定读者都已经具备了较扎实的Java基础知识,在这方面有欠缺的读者请自行阅读有关资料。
概念我在前面已经提到,RMI是一种远程方法调用机制,其过程对于最终用户是透明的:在进行现场演示时,如果我不说它使用了RNI,其他人不可能知道调用的方法存储在其他机器上。
当然了,二台机器上必须都安装有Java虚拟机(JVM)。
其他机器需要调用的对象必须被导出到远程注册服务器,这样才能被其他机器调用。
因此,如果机器A要调用机器B上的方法,则机器B必须将该对象导出到其远程注册服务器。
注册服务器是服务器上运行的一种服务,它帮助客户端远程地查找和访问服务器上的对象。
一个对象只有导出来后,然后才能实现RMI 包中的远程接口。
例如,如果想使机器A中的Xyz对象能够被远程调用,它就必须实现远程接口。
RMI需要使用占位程序和框架,占位程序在客户端,框架在服务器端。
在调用远程方法时,我们无需直接面对存储有该方法的机器。
在进行数据通讯前,还必须做一些准备工作。
占位程序就象客户端机器上的一个本机对象,它就象服务器上的对象的代理,向客户端提供能够被服务器调用的方法。
然后,Stub就会向服务器端的Skeleton发送方法调用,Skeleton就会在服务器端执行接收到的方法。
Stub和Skeleton之间通过远程调用层进行相互通讯,远程调用层遵循TCP/IP协议收发数据。
下面我们来大致了解一种称为为“绑定”的技术。
客户端无论何时要调用服务器端的对象,你可曾想过他是如何告诉服务器他想创建什么样的对象吗?这正是“绑定”的的用武之地。
RMI,远程方法调用(Remote Method Invocation)
RMI,远程方法调用(Remote Method Invocation)是Enterprise JavaBeans的支柱,是建立分布式Java应用程序的方便途径。
RMI是非常容易使用的,但是它非常的强大。
RMI的基础是接口,RMI构架基于一个重要的原理:定义接口和定义接口的具体实现是分开的。
下面我们通过具体的例子,建立一个简单的远程计算服务和使用它的客户程序一个正常工作的RMI系统由下面几个部分组成:●远程服务的接口定义●远程服务接口的具体实现●桩(Stub)和框架(Skeleton)文件●一个运行远程服务的服务器●一个RMI命名服务,它允许客户端去发现这个远程服务●类文件的提供者(一个HTTP或者FTP服务器)●一个需要这个远程服务的客户端程序下面我们一步一步建立一个简单的RMI系统。
首先在你的机器里建立一个新的文件夹,以便放置我们创建的文件,为了简单起见,我们只使用一个文件夹存放客户端和服务端代码,并且在同一个目录下运行服务端和客户端。
如果所有的RMI文件都已经设计好了,那么你需要下面的几个步骤去生成你的系统:1、编写并且编译接口的Java代码2、编写并且编译接口实现的Java代码3、从接口实现类中生成桩(Stub)和框架(Skeleton)类文件4、编写远程服务的主运行程序5、编写RMI的客户端程序6、安装并且运行RMI系统1、接口第一步就是建立和编译服务接口的Java代码。
这个接口定义了所有的提供远程服务的功能,下面是源程序://Calculator.java//define the interfaceimport java.rmi.Remote;public interface Calculator extends Remote{public long add(long a, long b)throws java.rmi.RemoteException;public long sub(long a, long b)throws java.rmi.RemoteException;public long mul(long a, long b)throws java.rmi.RemoteException;public long div(long a, long b)throws java.rmi.RemoteException;}注意,这个接口继承自Remote,每一个定义的方法都必须抛出一个RemoteException异常对象。
linux rm 命令详解
linux rm 命令详解
名称:rm
使用权限:所有使用者
使用方式:rm [options] name...
说明:删除档案及目录。
参数:
-i 删除前逐一询问确认。
-f 即使原档案属性设为唯读,亦直接删除,无需逐一确认。
-r 将目录及以下之档案亦逐一删除。
范例:
删除所有C语言程式档;删除前逐一询问确认:
rm -i *.c
将Finished 子目录及子目录中所有档案删除:
rm -r Finished
功能说明:删除文件或目录。
语法:rm [-dfirv][--help][--version][文件或目录...]
补充说明:执行rm指令可删除文件或目录,如欲删除目录必须加上参数"-r",否则预设仅会删除文件。
参数:
-d或--directory 直接把欲删除的目录的硬连接数据删成0,删除该目录。
-f或--force 强制删除文件或目录。
-i或--interactive 删除既有文件或目录之前先询问用户。
-r或-R或--recursive 递归处理,将指定目录下的所有文件及子目录一并处理。
-v或--verbose 显示指令执行过程。
--help 在线帮助。
--version 显示版本信息。
Infoprint 250 導入と計画の手引き 第 7 章ホスト
SUBNETMASK
255.255.255.128
Type of service...............: TOS
*NORMAL
Maximum transmission unit.....: MTU
*LIND
Autostart.....................:
AUTOSTART
*YES
: xx.xxx.xxx.xxx
: xx.xxx.xxx.xxx
*
(
)
IEEE802.3
60 1500
: xxxx
48 Infoprint 250
31. AS/400
IP
MTU
1
1
IPDS TCP
CRTPSFCFG (V3R2)
WRKAFP2 (V3R1 & V3R6)
RMTLOCNAME RMTSYS
MODEL
0
Advanced function printing............:
AFP
*YES
AFP attachment........................:
AFPATTACH
*APPC
Online at IPL.........................:
ONLINE
FORMFEED
*CONT
Separator drawer......................:
SEPDRAWER
*FILE
Separator program.....................:
SEPPGM
*NONE
Library.............................:
Linux服务器托管需要慎用的几个命令
Linux服务器租用需要慎用的几个命令Linux服务器租用用户在日常数据维护过程中需要使用命令对数据进行修改,然而其中有一部分的命令需要用户小心使用。
1、Linux Fork Bomb Command: (){ :: & };:以Fork Bomb闻名,是一个拒绝服务攻击的Linux系统。
: (){ :: & };:是一个bash函数。
只要被执行,他会不断重复,直到系统被冻结。
你只能重启系统解决这个问题。
所以当你在Linux界面执行这个命令时一定要注意。
2、Mv Folder/Dev/Null Commandmv folder/dev/null也是一个危险的命令。
Dev/null或者null device是一个删除全部写在这个设备文件上数据的设备文件,但是,该操作提示却是写入操作执行成功。
这就是我们常说的bit bucked或者black hole。
3、Rm -Rf Commandrm -rf命令在Linux系统中可以快速删除文件夹及其内容。
如果,你不知道如何正确使用它,你就只有哭了。
以下为m-rf命令最常见的组合和选择:rm command:删除Linux系统的文件rm -f command:不需提示,删除文件中的只读文件rm -r command:循环删除文件夹的内容rm -d command:删除空目录,如果非空目录则不会执行该操作rm -rf/ command:强制删除根目录中的全部内容和子文件夹(包括写保护文件)命令rm -rf* command:强制删除当前目录中的全部内容(当前工作目录)和字文件夹rm -rf. command:强制删除当前文件夹目录/子目录中的全部内容。
同rm -r.[^.]* The rm -r.[^.]* command:删除文件及文件夹,带有删除提示4、Mkfs Command如果你不知mkfs的效果,那么它也是一个危险的命令,mkfs之后写的任何命令都将会被一个空白的linux文件系统格式化、替代。
linux rm命令的用法
linux rm命令的用法# Linux RM命令详解与使用指南Linux环境下的`rm`命令是一种强大的文件和目录删除工具,但同时也需要用户谨慎操作,因为一旦执行删除操作且没有备份,数据将无法恢复。
以下是关于`rm`命令的详细说明及其用法。
## 一、基本语法```bashrm [选项] [文件或目录]```- `选项`:用于指定删除操作的具体行为。
- `[文件或目录]`:您想要删除的文件或目录的名称或路径。
## 二、常用选项1. `-f` 或 `--force`:强制删除,即使文件被设置为只读或者不存在也不给出提示信息。
2. `-i` 或 `--interactive=once`:在删除前询问用户是否确定,对于大量文件尤其有用,它只会询问一次,然后按照你的选择(yes/no)对后续的删除操作做出相应处理。
3. `-r` 或 `--recursive`:递归地删除目录及其包含的所有内容,这是删除目录时必须使用的选项。
4. `-v` 或 `--verbose`:显示详细的操作过程,即在删除每个文件或目录时给出相应的反馈信息。
## 三、示例用法1. 删除单个文件:```bashrm file.txt```2. 强制删除一个文件,不进行任何确认:```bashrm -f file.txt```3. 删除目录及其所有内容:```bashrm -r directory/```4. 在删除目录及其内容前先询问用户确认:```bashrm -ri directory/```5. 显示详细的删除过程:```bashrm -rv directory/```**重要安全提示:**- 使用`rm`命令时要格外小心,特别是配合`-rf`选项时,可能导致重要数据丢失且不可恢复。
- 在删除目录时务必确保你了解并确认该目录下所有文件及子目录的内容,避免误删重要数据。
总结来说,Linux的`rm`命令是一个强大而直接的工具,正确、谨慎地使用它可以有效地管理你的文件系统。
linux rm 参数
linux rm 参数Linux 操作系统中的RM 命令是用于删除文件的常用命令。
本文将介绍RM 命令的基本用法、进阶技巧以及实战案例,帮助读者更好地掌握这个命令。
一、Linux RM 命令简介在Linux 系统中,RM 命令的完整路径为`rm -i`,它用于删除指定的文件或目录。
当使用RM 命令时,系统会提示用户确认是否删除,以确保操作的安全性。
二、RM 命令的基本参数1.`-i`:交互式删除,删除文件前会提示用户确认。
2.`-f`:强制删除,不提示用户确认,直接删除文件。
3.`-r`:递归删除,用于删除目录及其子目录中的文件。
4.`-d`:删除空目录。
5.`-v`:显示删除过程中的详细信息。
6.`-x`:当文件或目录无法删除时,尝试使用`rm -f` 强制删除。
三、RM 命令的进阶用法1.利用通配符删除文件:例如,删除所有以".txt" 结尾的文件,可以使用"rm *.txt" 命令。
2.利用正则表达式删除文件:例如,删除所有包含"example" 的文件,可以使用"rm *example*" 命令。
3.同时删除多个文件:可以使用"rm file1 file2 file3" 命令。
4.按顺序删除多个文件:可以使用"rm file1 file2 file3" 命令,系统会依次删除文件,而不是同时删除。
四、实战案例与注意事项1.案例一:删除单个文件```rm -i example.txt```2.案例二:删除多个文件```rm file1.txt file2.txt file3.txt```3.案例三:删除目录及其子目录中的文件```rm -rf directory_name```4.注意事项:- 在使用RM 命令删除文件时,请确保确认文件是否确实需要删除,以免误删重要数据。
- 尽量避免在操作系统或程序运行过程中使用RM 命令删除重要文件,以免造成系统崩溃。
linux rm命令的参数
linux rm命令的参数Linux rm命令参数详解在Linux系统中,rm命令用于删除文件和目录。
它是一个非常常用的命令,但是在使用时需要小心,以免误删重要文件或目录。
本文将详细介绍rm命令的各个参数及其用法,帮助读者更好地理解和使用这个命令。
1. -r 参数-r参数用于删除目录及其子目录下的所有文件和子目录。
当我们需要删除一个目录以及其中的所有文件和子目录时,就可以使用这个参数。
例如,要删除名为"mydir"的目录及其子目录下的所有文件和子目录,我们可以使用命令"rm -r mydir"。
2. -f 参数-f参数用于强制删除文件或目录,即使文件或目录是只读的或者不存在。
通常情况下,当我们尝试删除只读文件或不存在的文件时,系统会提示我们进行确认,以防止误删。
但是使用-f参数后,系统将不再提示确认,直接删除目标文件或目录。
例如,要强制删除名为"myfile"的文件,我们可以使用命令"rm -f myfile"。
3. -i 参数-i参数用于删除文件或目录之前进行确认。
当我们使用该参数时,系统会在删除前提示我们进行确认,以防止误删重要文件或目录。
例如,要删除名为"myfile"的文件之前进行确认,我们可以使用命令"rm -i myfile"。
4. -d 参数-d参数用于删除空目录。
当我们尝试删除一个非空目录时,系统会给出错误提示,以防止误删。
但是使用-d参数后,系统将只删除空目录,而不会给出错误提示。
例如,要删除名为"emptydir"的空目录,我们可以使用命令"rm -d emptydir"。
5. --preserve-root 参数--preserve-root参数用于防止误删根目录。
当我们尝试删除根目录时,系统会给出错误提示,以防止误删。
linux删除命令rm的使用
linux删除命令rm的使用
在linux 中创建文件很容易,系统中随时会有文件变得过时且毫无用处。
用户可以用rm 命令将其删除。
该命令的功能为删除一个目录中的一个或
多个文件或目录,它也可以将某个目录及其下的所有文件及子目录均删除。
对于链接文件,只是删除了链接,原有文件均保持不变。
rm 命令的一般形式为:
rm [选项] 文件
如果没有使用- r 选项,则rm 不会删除目录。
该命令的各选项含义如下:
- f 忽略不存在的文件,从不给出提示。
- r 指示rm 将参数中列出的全部目录和子目录均递归地删除。
- i 进行交互式删除。
使用rm 命令要格外小心。
因为一旦一个文件被删除,它是不能被恢复的。
例如,用户在输入cp,mv 或其他命令时,不小心误输入了rm 命令,当用户按了回车键并认识到自己的错误时,已经太晚了,文件已经没有了。
为了防止此种情况的发生,可以使用rm 命令中的i 选项来确认要删除的每个文件。
如果用户输入y,文件将被删除。
如果输入任何其他东西,文件将被保留。
在
下一个例子中,用户要删除文件test 和example。
然后会被要求对每个文件进行确认。
用户最终决定删除example 文件,保留teST 文件。
$ rm - ii test example
Remove test ?n
Remove example ?y
如果需要删除目录机构庞大,使用-r 时每个目录都会询问,所有目录。
rm命令用法 -回复
rm命令用法-回复rm命令是Linux及其他类Unix操作系统中的一个常用命令,用于删除文件或目录。
它可以通过不同的选项和参数来实现各种删除操作。
在本文中,我们将详细介绍rm命令的用法,并逐步回答一些常见的问题。
1. 什么是rm命令?rm命令是remove的缩写,它用于删除指定文件或目录。
它是一个非常强大的命令,可以在不需要确认的情况下永久删除文件,因此使用时应小心。
2. 如何使用rm命令删除文件?要使用rm命令删除文件,可以简单地在命令行中键入rm,然后加上要删除的文件的路径和文件名。
例如,要删除当前目录中的一个名为"file.txt"的文件,可以运行以下命令:shellrm file.txt请注意,一旦删除文件,它将无法恢复。
因此,在使用rm命令删除文件之前,请确保您不再需要该文件,并且已经创建了任何必要的备份。
3. 如何使用rm命令删除目录?与删除文件类似,要使用rm命令删除目录,可以键入rm,然后在路径和目录名之后加上"-r"选项,以递归地删除目录中的所有文件和子目录。
例如,要删除名为"example_directory"的目录及其所有内容,可以运行以下命令:shellrm -r example_directory在运行这个命令之前,请确保您不再需要目录中的任何文件或子目录,并且已经创建了任何必要的备份。
4. 如何使用rm命令强制删除文件或目录?有时,在删除文件或目录时,rm命令会询问用户是否真的希望删除。
为了避免这种提示,可以使用"-f"选项,以强制删除,即使文件或目录是只读或受保护的。
例如,要强制删除名为"protected_file.txt"的只读文件,可以运行以下命令:shellrm -f protected_file.txt请注意,在使用"-f"选项时,rm命令将不会给予删除操作的任何确认。
能提高效率的Linux命令行技巧
能提高效率的Linux命令行技巧令,可以为它设置一个别名,在删除文件之前需要进行确认才能删除。
有些系统管理员会默认使用这个别名,对于这种情况,你可能需要看看下一个技巧。
$ rm -i <== 请求确认关闭别名你可以使用unalias 命令以交互方式禁用别名。
它不会更改别名的配置,而仅仅是暂时禁用,直到下次登录或重新设置了这一个别名才会重新生效。
$ unalias rm如果已经将rm -i 默认设置为rm 的别名,但你希望在删除文件之前不必进行确认,则可以将unalias 命令放在一个启动文件(例如~/.bashrc)中。
使用sudo如果你经常在只有root 用户才能执行的命令前忘记使用sudo,这里有两个方法可以解决。
一是利用命令历史记录,可以使用sudo !!(使用!! 来运行最近的命令,并在前面添加sudo)来重复执行,二是设置一些附加了所需sudo 的命令别名。
$ alias update=’sudo apt update’更复杂的技巧有时命令行技巧并不仅仅是一个别名。
毕竟,别名能帮你做的只有替换命令以及增加一些命令参数,节省了输入的时间。
但如果需要比别名更复杂功能,可以通过编写脚本、向.bashrc 或其他启动文件添加函数来实现。
例如,下面这个函数会在创建一个目录后进入到这个目录下。
在设置完毕后,执行source .bashrc,就可以使用md temp 这样的命令来创建目录立即进入这个目录下。
md () { mkdir -p "$@" }总结使用Linux 命令行是在Linux 系统上工作最有效也最有趣的方法,但配合命令行技巧和巧妙的别名可以让你获得更好的体验。
【技术】RM 中image类型meter全面解析
Image类型的meter全解我先简单的介绍一下这个meter的作用:Image meter 用来显示图片,不需要绑定一个measure,而且经常从审美的角度被用来显示指定的图片。
然而当与measure一起使用的时候,他会显示measure 测量值的图片(例如,measure得到值为1,那么就显示1.png这个图片)可以用以下命令修改图片:ImageCrop -> GreyScale -> ImageTint -> ImageFlip -> ImageRotate.RM中使用image这个类型的meter是很常见的,而且它时常丰富了我们的皮肤的界面,让使用者的视觉得到了享受,我想现在所谓的RM爱好者,在下载一个皮肤的时候,第一要素就是有视觉的冲击力,能够激发你去下载这个皮肤,你觉得这个皮肤界面漂亮,而不是在乎它的功能什么的,所以这就是所谓的实用皮肤不受青睐的原因之一了.好了,言归正传,下面本文将为大家仔细讲解image的各个环节,和具体的使用.第一节:Image各个选项的设定被显示图片的名字。
IMAGENAME可以引用一个或者多个measureName :Meter=IMAGEMeasureName=SomeMeasureMeasureName2=SomeMeasure2ImageName=%1-%2.png如果ImageName 没有指定, MeasureName 追加“.png”作为图片.Path皮肤文件夹中图像的相对位置.AntiAlias如果设置为1,当图片显示时进行抗锯齿PreserveAspectRatio如果设置为1,缩放图象是保留长宽比,默认为0o当PreserveAspectRatio=0,你可以定义宽度和高度,会缩放图片到指定尺寸,不会保留长宽比o当PreserveAspectRatio=1,你可以指定宽度或者高度,图片会被缩放到指定值,另一个会根据长宽比自动缩放o当PreserveAspectRatio=1,你可以指定宽度和高度,图片使用原图片宽度和高度中最大的值,把它更改为用户指定的值,并且把另一边按照长宽比自动缩放。
Linuxrm命令详解
Linuxrm命令详解rm常见命令参数rm: 可以备份,尽量不要删除,⽐删除更好的是重命名 -->只删除⽂件链接,重启、重新写⼊后回收删除⽂件时,使⽤绝对路径或者进⼊到⽬标路径下后使⽤删除命令 –> 禁⽌使⽤rm –rf ./XXX⽂件【少个点就是根⽬录了】-r : 删除⽂件夹-f : 强制删除⽂件rm命令删除⽂件的原理⽂件删除原理: Linux通过⽂件link的数量控制⽂件的删除,只有当⼀个⽂件不存在任何link的时候且没有程序调⽤的时候,⽂件才会被真正删除。
就rm命令⽽⾔,就是减少磁盘引⽤计数i_link(⽂件到inode的链接数量);inode节点指向存储数据的block,删除⽂件并不是清除inode和block,⽽是将⽂件的硬链接为0,引⽤计数为0 才能删除⽂件注:如果有新的数据存储或者系统通过类似fsck命令做磁盘检查的时候,被删除的数据块和⽬录会被释放,数据⽆法找回⽂件删除的条件:i_nlink ⽂件的硬链接数量,磁盘的引⽤计数器i_count 内存引⽤计数(⼀个⽂件被⼏个程序调⽤,有⼀个程序使⽤i_count + 1 )i_link = 0 && i_count =0删除⼀个⽂件,也是删除上⼀级⽬录的block⾥⾯的⽂件名rm相关的问题答疑问题1:当执⾏了删除操作后,ls ⽆法查找到这个⽂件,但是调⽤这个删除⽂件的进程却正常执⾏,依然能够读取和写⼊⽂件内容?答案:因为rm只是减少了i_nlink,如果没有其他的链接了[即i_link=0】,但由于⽂件依然被进程使⽤,所以即时执⾏了rm命令,系统并未真正的删除。
只有当i_link和i_count==0时候,系统才会整正删除这个⽂件,也就是删除⽂件还需要解除进程对该⽂件的调⽤才⾏。
问题2:当⽂件没有被调⽤,但是执⾏了rm命令,删除后的⽂件还能找回来么?答案:rm只是减少了i_link的数量,实际就是将⽂件的inode的链接删除了,但是并没有删除⽂件实体(block数据块),如果停⽌机器⼯作,还是可以找回数据的。
linux中的rm命令的详细解释
linux中的rm命令的详细解释linxu下的rm命令是一个删除命令,用来删除文件或者目录。
下面由小编为大家整理了linux的rm命令的详细解释的相关知识,希望对大家有帮助!一、linux中的rm命令的详细解释1.命令格式:rm [选项] 文件···2.命令功能:删除一个目录中的一个或多个文件和目录,如果没有使用-r 选项,则rm不会删除目录。
如果使用rm 来删除文件,通常仍可以将该文件恢复原状。
3.命令参数:-f, --force 忽略不存在的文件,从不给出提示。
-i, --interactive 进行交互式删除-r, -R, --recursive 指示rm将参数中列出的全部目录和子目录均递归地删除。
(通用参数,recursive,递归)-v, --verbose 详细显示进行的步骤(通用参数,基本都是这个verbose)--help 显示次帮助信息并退出(通用参数)--version 输出版本信息并推出(每次的输出结构都一样,巴拉巴拉,下次不写它了)二、Linux中的rm命令的使用实例实例一:删除文件file,系统会先询问是否删除命令:rm filenamerm:是否删除一般文件“filename”? N/Y,这个是一个交互,可以反悔实例二:强行删除file,系统不再提示。
命令:rm -f log.log 然后呢?然后就没有了。
实例三:删除任何.log文件;删除前逐一询问确认命令:rm -i *.log实例四:将test目录及目录中所有文档全部删除命令:rm -r test 会提示确认实例五:rm -rf test1命令会将test1 目录及目录中所有文档删除,并且不会提示你确认命令:rm -rf test1实例六:删除以-f开头的文件命令:rm -- -f实例七:自定义回收站功能命令:myrm(){ D=/tmp/$(date + %Y$m%d%H%M%S); mkdir -p $D; mv "$@" $D && echo "moved to $D ok"; }三、Linux中rm命令的其他用法1. 删除带“-”的文件名的方法大部分是由于误操作的原因,产生了一些特殊字符的文件如-foorm --help用法:rm [选项]... 目录...Remove (unlink) the FILE(s).-d, --directory unlink FILE, even if it is a non-empty directory(super-user only; this works only if your systemsupports `unlink' for nonempty directories)-f, --force ignore nonexistent files, never prompt-i, --interactive prompt before any removal--no-preserve-root do not treat `/' specially (the default)--preserve-root fail to operate recursively on `/'-r, -R, --recursive remove the contents of directories recursively-v, --verbose explain what is being done--help 显示此帮助信息并离开--version 显示版本信息并离开要删除第一个字符为‘-’的文件(例如‘-foo’),请使用以下其中一种方法:rm -- -foorm ./-foo请注意,如果使用rm 来删除文件,通常仍可以将该文件恢复原状。
Linux系统中rm命令的参数及用法详解
Linux系统中rm命令的参数及用法详解Linux系统中rm命令是remove的缩写,是一个删除命令。
下面由店铺为大家整理了Linux系统中rm命令的参数及用法详解的相关知识,希望对大家有帮助!Linux系统中rm命令的参数及用法详解:参数说明rm是一个危险的命令,使用的时候要特别当心,尤其对于新手,否则整个系统就会毁在这个命令(比如在/(根目录)下执行rm * -rf)。
所以,我们在执行rm之前最好先确认一下在哪个目录,到底要删除什么东西,操作时保持高度清醒的头脑。
1.命令格式:rm [选项] 文件…2.命令功能:删除一个目录中的一个或多个文件或目录,如果没有使用- r选项,则rm不会删除目录。
如果使用 rm 来删除文件,通常仍可以将该文件恢复原状。
3.命令参数:-f, --force 忽略不存在的文件,从不给出提示。
-i, --interactive 进行交互式删除-r, -R, --recursive 指示rm将参数中列出的全部目录和子目录均递归地删除。
-v, --verbose 详细显示进行的步骤--help 显示此帮助信息并退出--version 输出版本信息并退出Linux系统中的rm命令参数及用法详解:用法详解实例一:删除文件file,系统会先询问是否删除。
命令:rm 文件名输出:复制代码代码如下:[root@localhost test1]# ll总计 4-rw-r--r-- 1 root root 56 10-26 14:31 log.logroot@localhost test1]# rm log.logrm:是否删除一般文件“log.log”? yroot@localhost test1]# ll总计 0[root@localhost test1]#说明:输入rm log.log命令后,系统会询问是否删除,输入y后就会删除文件,不想删除则数据n。
实例二:强行删除file,系统不再提示。
rmdir参数
rmdir参数摘要:1.介绍rmdir 参数的含义和作用2.详细说明如何使用rmdir 参数3.分析使用rmdir 参数的优势和注意事项4.实例展示rmdir 参数的具体应用正文:一、rmdir 参数的含义和作用在Linux 和Unix 系统中,rmdir(remove directory)命令用于删除空目录。
当我们需要删除一个已经为空的目录时,可以使用rmdir 命令。
而rmdir 参数则是在执行该命令时,用来指定待删除目录的路径。
二、如何使用rmdir 参数在使用rmdir 命令时,需要在命令行后跟上待删除目录的路径,并使用-p 选项来强制删除目录。
如果需要一次删除多个目录,可以在命令行中同时输入多个路径参数。
示例:```rmdir -p /path/to/dir1 /path/to/dir2```三、使用rmdir 参数的优势和注意事项1.优势:rmdir 参数能够方便地删除多个空目录,提高了操作效率。
2.注意事项:- 在使用rmdir 命令时,必须确保目标目录为空,否则会导致无法删除目录。
- 在执行rmdir 命令时,需要谨慎使用-p 选项,以免误删除重要文件或目录。
四、实例展示rmdir 参数的具体应用假设我们有以下目录结构:```/project/│├──dir1/│└──file1.txt│└──dir2/└──file2.txt```现在我们想要删除dir1 和dir2 目录,可以使用以下命令:```rmdir -p /project/dir1 /project/dir2```执行后,目录结构将变为:```/project/│└──file2.txt```总结:通过本文的介绍和实例,相信大家已经对rmdir 参数有了更深入的了解,可以根据实际需求灵活运用该参数来提高操作效率。
rm命令参数详解
rm命令参数详解The `rm` command in Unix-like operating systems is used to delete files or directories. It has several options or parameters that can be used to control its behavior. Here's a detailed breakdown of some common `rm` command parameters:Unix-like操作系统中的`rm`命令用于删除文件或目录。
它有几个选项或参数,可以用来控制其行为。
以下是一些常见的`rm`命令参数的详细解释:`-r` or `-R`: Recursively delete directories and their contents. `-r`或`-R`:递归删除目录及其内容。
`-f`: Force deletion, ignoring nonexistent files and without prompting for confirmation.`-f`:强制删除,忽略不存在的文件,并且不提示确认。
`-i`: Prompt for confirmation before deleting each file or directory. `-i`:在删除每个文件或目录之前提示确认。
`--preserve-root`: Prevent deletion of files or directories with a `/` prefix, which typically represents the root directory.`--preserve-root`:防止删除以`/`为前缀的文件或目录,这通常代表根目录。
`-v`: Display verbose output, showing the names of the files or directories being deleted.`-v`:显示详细的输出,列出正在被删除的文件或目录的名称。
rm ha原理
rm ha原理rm 命令是Linux 系统中常用的一个命令,它用于删除文件或目录。
rm 是 remove 的缩写,ha 是对 rm 的原理进行解析,本文将详细介绍 rm 命令的原理及其使用方法和注意事项。
一、rm 命令的原理rm 命令的原理很简单,它通过系统调用来删除指定的文件或目录。
在Linux 系统中,每个文件或目录都有一个索引节点(Inode),rm 命令实际上是通过删除这个索引节点来完成文件或目录的删除操作。
具体来说,rm 命令会首先检查要删除的文件或目录是否存在,如果不存在则会提示错误信息。
如果存在,则会获取该文件或目录的索引节点号,并将其从文件系统的目录结构中删除。
在删除文件时,rm 命令只会删除文件的索引节点,而不会将文件内容从磁盘上删除,所以可以通过一些数据恢复工具来恢复被删除的文件。
而在删除目录时,rm 命令会递归地删除目录下的所有文件和子目录。
二、rm 命令的使用方法1. 删除文件:可以使用 rm 命令删除指定的文件,例如:```rm file.txt```该命令将删除当前目录下的 file.txt 文件。
2. 删除目录:如果要删除一个目录及其下面的所有文件和子目录,可以使用 rm 命令的 -r 参数,例如:```rm -r dir```该命令将删除当前目录下的dir 目录及其下面的所有文件和子目录。
3. 删除多个文件:可以同时删除多个文件,例如:```rm file1.txt file2.txt```该命令将删除当前目录下的 file1.txt 和 file2.txt 文件。
三、rm 命令的注意事项1. 删除文件时要谨慎操作,一旦删除就无法恢复。
在删除文件之前,最好先备份文件,以防止误删或不可挽回的损失。
2. 删除目录时要特别小心,尤其是使用rm -r 命令删除目录时。
这个命令会递归地删除目录下的所有文件和子目录,如果没有谨慎操作很容易造成数据丢失。
3. 使用rm 命令删除文件或目录时,系统不会提供任何确认操作的提示,所以要确保要删除的文件或目录是正确的。
docker系列-基础镜像环境和Docker常用命令整理
docker系列-基础镜像环境和Docker常⽤命令整理在hub官⽹会经常能看到 alpine 字样, alpine 是要给⾮常轻量级的Linux发⾏版,Docker官⽅已经推荐使⽤alpine 代替之前的 Ubuntu作为基础镜像环境, 好处是制作出的最终镜像⽂件很多, 但docker dub上⽬前仍以 Ubuntu 为主流的基础镜像环境.=======================⽤于 docker 命令学习的镜像和命令=======================下⾯镜像常⽤于 docker 命令学习docker pull nginx:1.15-alpine #只需要20M的空间docker pull busybox #只占⽤2M空间以守护态运⾏容器, 经常⽤于容器的学习.docker run -d --name mybusybox busybox /bin/sh -c "while true; do echo hello world; sleep 1; done"使⽤镜像nginx:1.15-alpine以后台模式启动⼀个容器, 并将容器的80端⼝映射到主机随机端⼝(80是该镜像expose的端⼝)docker run -P -d --name mynginx1 nginx:1.15-alpine使⽤镜像nginx:1.15-alpine以后台模式启动⼀个容器, 指定主机的端⼝为 80docker run -p 80:80 -d --name mynginx2 nginx:1.15-alpine=======================docker 容器端⼝映射=======================1. 指定host端⼝和容器内端⼝使⽤镜像nginx:1.15-alpine以后台模式启动⼀个容器, 指定主机的端⼝为80, 冒号前的host端⼝, 冒号后为容器内部的端⼝.docker run -p 80:80 -d --name mynginx2 nginx:1.15-alpine2. 容器内端⼝随机分配⼀个Host端⼝下⾯ -p 参数的 80 指的是容器内部的端⼝, 没有指定host端⼝, docker在主机上⾃动开放⼀个映射端⼝(当然是未被占⽤的), ⾃动端⼝号⼀般⼤于等于 32768 .docker run -p 80 -d --name mynginx2 nginx:1.15-alpine3. ⾃动为所有的 Dockerfile EXPOSE 端⼝映射Host端⼝Dockerfile EXPOSE 可能会开放多个端⼝, 使⽤ -P 参数将⾃动为这些容器内部端⼝分配对应的Host主机端⼝docker run -P -d --name mynginx1 nginx:1.15-alpine=======================docker 的⼀些常⽤命令=======================docker images 命令, 显⽰可⽤的容器docker rmi <镜像Id> 命令,删除指定镜像docker pull hello-world 命令 , 下载 hello-world imagedocker rmi <镜像Id> 命令,删除指定镜像docker ps 命令, 列出当前正在运⾏的容器, 结果的第⼀列是container_Id, 第2列是容器名称.docker ps -a 命令, 列出当前正在运⾏的和之前运⾏完的容器docker stop container_id/container-name 命令, 停⽌指定的容器, 该容器Id或名称可以从docker ps中获取.docker restart container_id/container-name 命令, 重新启动指定的容器, 该容器Id或名称可以从docker ps中获取.docker start container_id/container-name 命令, 启动指定的容器, 该容器Id或名称可以从docker ps中获取.docker rm container_id/container-name, 删除指定的容器docker rm $(docker ps -a -q) 命令, 删除所有运⾏结束了容器, 正在运⾏的容器不会被删除docker top container_id/container-name, 查看容器内的进程docker logs [-f] [-t] [--tail string] 容器名, 查看容器的⽇志输出, -f是打开跟踪, -t是加上时间戳, --tail 100 表⽰仅显⽰最后的100⾏⽇志docker search nginx, 在hub站点中搜索 nginx 镜像docker image inspect image_id 命令, 显⽰指定镜像的详细信息.docker container inspect container_id/container-name 命令, 显⽰指定容器的详细信息,包括容器的Ipdocker images -f dangling=true 命令, 列出没有被容器化的镜像docker rmi $(docker images -qf dangling=true) 命令, 删除那些没有被容器化的镜像docker system df 命令, 可以⼀次性查看镜像/容器/host volume的磁盘占⽤情况.docker ps -s 命令, 输出容器的空间占⽤=======================docker ⼀些管理命令集=======================除了上⾯常⽤的命令外, docker 还有⼀些管理命令集, 这些命令集还可以包含⼆级命令:config Manage Docker configscontainer Manage containersimage Manage imagesnetwork Manage networksnode Manage Swarm nodesplugin Manage pluginssecret Manage Docker secretsservice Manage servicesstack Manage Docker stacksswarm Manage Swarmsystem Manage Dockertrust Manage trust on Docker imagesvolume Manage volumes⽐较常⽤的是,docker image build, 编译 Dockfiledocker network create, 创建 docker ⽹络docker volume create, 创建数据卷=======================docker run/exec 命令=======================运⾏ hello-world 容器, 如果本地没有下载, 将会⾃动从hub站点下载.docker run hello-world 命令以守护态运⾏容器docker run -d --name mybusybox busybox /bin/sh -c "while true; do echo hello world; sleep 1; done"登陆⼀个容器, 运⾏中的容器其实是⼀个功能完备的Linux操作系统, 所以我们可以在登陆该容器执⾏常规的Linux命令.docker exec -it container_id/container-name /bin/bash使⽤ redis-cli 登陆 myredis 容器docker exec -it myredis redis-cliexec 后的 -it 参数的意思是, 以交互的⽅式并分配⼀个伪tty, 经常⼀起联⽤.=======================docker redis 使⽤=======================# 下载最新版的 redis imagedocker pull redis:latest# 简单⽅式启动 redis 服务pull run redisdocker run --name itbilu-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-pass -d mysql:5.7我们就创建了⼀个名为 itbilu-mysql 的MySQL数据库服务器容器实例, 在创建数据库时,通过环境变量MYSQL_ROOT_PASSWORD设置数据库的root密码,还通过5.7标签指定了所使⽤的镜像版本。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
around and be restless.apple of one’s eye that which is held dearest Because it is essential to sight,the eye’s apple,or pupil,is to be cherished and protected.at the end of the rope out of patience An animal at the end of its tether cannot goany further.bark up the wrong tree follow an incorrect course Hunting dogs were trained to tree raccoonsand bark,but often the raccoon fooled themand escaped.batting a thousand doing a perfect job1,000 is the perfect average in baseball,with abase hit every time at bat.beat around the bush not getting to the point Hunters need to proceed slowly and carefully ifapproaching a bush to beat out a bird. behind the eight ball out of luck The eight ball in a pool game must be sunk lastor the person loses.between the devil and between two dangers Wooden ship decks have long seams atthe deep blue sea the edges called devils.Sailors repairing themrisk falling overboard.bite off more than one can try to do more than one has One who takes a very large bite is trying chew time or ability for.to chew too much in a mouthful.bitter pill to swallow hard to accept Some bitter ingredients in pills cannot bemasked and are hard to swallow.blow off steam release anger or tension Early steam engines had no safety valves,soengineers pulled a lever to release pressure. blow one’s stack vent anger,lash out A steamboat’s smokestack could blow off if theboiler overheated.bone to pick an area of contention Two dogs will fight over a single bone tossedbetween them.bone up refine,study Bones were once used to polish shoes;to studywould polish one’s knowledge.born with silver spoon in wealthy Sterling silver is expensive;babies in rich one’s mouth families may have had silver baby spoons. break the ice to initiate and be friendly Sometimes it is necessary for ships to break upthe ice so other ships can pass.bring the house down applauding enthusiastically The applause a performer receives may seemlike it could cause a building to collapse.burn the candle at both ends doing too much Candles would burn quickly and run out ofenergy if the wick was lit on both ends.bury the hatchet let bygones be bygones When peace was made between two Indiantribes,it was customary to bury the chiefs’tomahawks.butterflies in one’s stomach nervous,fearful A nervous stomach feels fluttery.by the skin of one’s teeth barely escaped Teeth have no skin,only a thin film.bury head in sand ignore danger Saying comes from a mistaken belief thatostriches bury heads in sand when afraid;actually,they are eating or sleeping.call it a day to quit This refers to the end of the workday.carry a torch loving someone Venus,goddess of love,carries a torch.carry the weight of the world worried Zeus,king of the Greek gods,punishedon one’s shoulders Atlas by making him carry the heavens.chew the fat talk Sailors worked their jaws on tough salt pork ina motion similar to talking.chip off the old block like one’s parent A piece of wood has the same characteristicsas the larger block it was cut from.chip on one’s shoulder negative attitude When two boys fought in olden days,onewould have a chip on his shoulder and theother would try to knock it off.cold feet nervous,hesitant People jumping into cold water mightcomplain of cold feet and back out.cold shoulder reject someone Knights got hot meals,but unwelcome guestswere given cold mutton shoulder.close shave narrow escape from danger A razor blade has a dangerous edge. couldn’t see the forest too close to a project or A forest may be so thick that one is not able through the trees problem to see solution to see much of it beyond the close trees. counting chickens before making plans based on what Farmers cannot count on one chicken per egg they hatch has not yet happened since some will not hatch.cream someone,to totally beat Cream is whipped to harden.crocodile tears faked crying Crocodiles can’t shed real tears,but moan andcry to attract sympathetic helpers,only tosnatch and eat them.cry over spilled milk feel bad if it can’t be undone Once milk has been spilled,little can be doneabout it.cry wolf to lie or spread alarm Aesop’s fable tells of a shepherd who calledfalse “wolf”alarms;when the real wolfappeared,no one came.cup of tea favorite Tea has many flavors;people have favorites. cut off your nose to spite harm yourself while trying Spiteful behavior generally ends up hurting your face to hurt another the one who is doing it.day late and a dollar short unsuccessful This century-old saying describes someonewho just misses being successful.dead as a doornail not responsive,dead Since nails weren’t typically used in doors,means,“dead as something that never existed.”dog-eat-dog doing whatever is necessary Competition among dogs for food may maketo get one’s way life in the wild difficult.down in the dumps feeling dismal and depressed Being in a garbage dump would feel gloomy. dyed in the wool deeply ingrained traits Wool that is dyed before it is spun into yarnholds its color better.early bird catches the worm the person to start the job Birds are out early looking for food.first succeedseat one’s words regret something said When a courier delivered parchment bearingbad news to a nobleman,the angry noblemanmade the courier eat the paper.elbow grease hard work A slang expression for sweat since the 1600s. eyes bigger than stomach ask for more than can Hungry people may look at food and decidebe eaten they can eat more than they actually can.face the music stand up to adversity In the army,the Rogue’s March was playedwhen offenders were drummed out.fair-weather friend person who does not stick Some friends are there for you when thingswith friend having problems are good,but flee when things are bad. feather in one’s cap something to be proud of American Indians often wore feathers to showtheir bravery in past wars.fish out of water outside natural element A fish out of water is out of its element andcannot function properly.fit as a fiddle in great shape Fiddles must be carefully tuned.flash in the pan something that starts well, A gunpowder flash in the priming pan ofbut goes downhill muskets made them fire;they sometimesflashed but didn’t fire.fly in the ointment something spoiling things In the Old Testament,dead flies ruin theapothecary’s ointments.fly off the handle lose control Handmade axes sometimes flew off the handleand injured someone nearby.for the birds foolish,worthless Birds have limited intelligence.forty winks short nap The number 40 was used in old stories,such asthose about Ali Babba and Noah’s Ark,to meanan indefinite number.full of hot air talks a lot,does little Hot air balloons,when filled with hot air,canfloat away.get down to brass tacks get to the bottom of things Hidden brass tacks usually hold upholsteryfabric to the furniture’s frame.get in someone’s hair bother or annoy It is especially difficult to remove certain thingsfrom hair.get one’s goat annoy and make angry Goats are often kept in stables of high-strungracehorses because goats tend to calm horses. get the brush-off be dismissed,pushed aside Certain brushes rid clothes of lint.get up on wrong side of bed be in a bad mood Romans thought getting up on the left side ofthe bed brought bad luck.give a taste of own medicine do same bad thing to person Tasting someone’s gross medicine,such aswho did it to you castor oil,might make one more sympathetic. going bananas acting ridiculous Monkeys love bananas and can act crazy. going to the dogs run-down,needs repaired Dogs were once lowly hunting animals,notpets,so they were fed leftover scraps.gone to pot ruined Food breaks down in stewing pot.good sport one who doesn’t complain In sports,losers should accept defeat.goose is cooked plans are ruined Medieval townspeople hung a goose outsidethe town to insult attackers.The enemy thenburned the town down.green thumb talent for growing things Stories tell of an Italian monk who had a greenthumb,which made him a fine gardener. green with envy quite jealous Green is associated with envy so jealous suitorsused green jade as a potion.hands were tied unable to help in any way Captives’hands are tied,which renders thempowerless.have one’s head in clouds not know what is going on One whose head is in the clouds cannot keeptrack of what is going on.heart in one’s mouth nervous If you are scared and catching your breath,itmight feel like your heart is in your mouth. high horse acting superior In parades in medieval England,royalty rode onhorses at least a hand taller than the averagemount.hit the nail on the head be exactly right The correct way to hit a nail is on the head.hit the spot satisfies fully The spot is the bull’s eye on a target.hold your horses be patient Jockeys must not start their horses before thesignal is given.hold your tongue watch what you say If one’s tongue is held in place,it would beimpossible to speak.horse of a different color a different matter or way In medieval tournaments,armored knightsof looking at something were distinguished by the color of their horses. in a nutshell in very few words The Bible,Koran,and Iliad have all been copiedin such tiny print that they fit in a nutshell.in a pickle in trouble Falling into pickling solution (brine,vinegar)would be unpleasant.in one ear and out the other not hearing or remembering Something that passes right through makes noimpression on the mind.in the bag success is assured Birds and other small animals safely in thegame bag mean a successful hunt.in the doghouse in trouble for doing Stories tell of husbands whose wives madesomething bad or wrong them sleep in the doghouse when in trouble. jump off the deep end take risky action without For one who cannot swim,the deep end of asufficient thought pool is dangerous.jump out of one’s skin be extremely frightened When frightened one may jump so quickly thatskin is left behind.jump the gun start too soon An anxious runner may jump before the starterfires the pistol in a track event.keep one’s shirt on stay patient or calm Men used to take off their stiff,starched shirtsbefore engaging in a fight.kick the bucket die Friends sprinkle a deceased’s body with holywater from a bucket.kill time to waste time waiting Once time is past,it is gone forever.knee-high to a grasshopper very young and small Grasshoppers are quite small and have distinctbends in their legs,like a knee.know the ropes be familiar with details Experienced sailors knew the ropes on theirsailing vessels.knuckle under submit to defeat In British taverns,people knocked knucklesunder the table when beaten in an argument. lay an egg fail or flop In the sport cricket,“duck’s egg”means noscore,so the game is lost if an egg is laid. leave no stone unturned look everywhere Polycrates found the treasure that the Persianshad hidden in the battlefield by turning overevery stone.let sleeping dogs lie do not stir up trouble An aroused pack of dogs can be dangerous. lemon appliance or car that has The sour taste of a lemon can cause oneconstant problems to pucker face into what looks like a scowl.let the cat out of the bag tell the secret Unscrupulous merchants put cats in bags thatwere supposed to contain piglets.lion’s share the largest allotment In Aesop’s fable,the lion hunts with otheranimals,but claims all the spoils of the hunt. look a gift horse in the mouth don’t complain about present You can tell a horse’s age by its teeth.mad as a wet hen furious Hens don’t actually become upset from gettingwet,so this expression isn’t accurate.mind one’s Ps and Qs be careful and precise A “p”reversed carelessly looks like a “q.”nose to the grindstone working very hard Grindstones are tools used for working.off one’s rocker behaving in a crazy manner One who is insane might not be able to stayseated in a chair and may fall out.once in a blue moon infrequently to never Blue moon refers to the rare celestialoccurrence of two full moons in a month.on cloud nine feeling elated or happy Meteorologists classify clouds by number,withnumber nine being the highest clouds.on pins and needles very nervous These sharp objects could make one quiteuncomfortable.open a can of worms start trouble that is hard Worms are wiggly and would be difficult toto stop contain.out of the woods out of trouble or difficulty Danger seems to lurk in the woods,partiallybecause one cannot see what is ahead.out on a limb a risky,unsure position Limbs get thinner the further away they arefrom the trunk;too much weight may causethem to break.over the hill getting too old Comparing life to a hill,once people pass themidpoint,they are headed downhill.over a barrel in a submissive position Before modern lifesaving methods,lifeguardstried to save drowning victims by rolling themback and forth over a barrel.pain in the neck obnoxious and irritating Having a pain in the neck is irritating.paint the town red have a wild time In olden days,bonfires lit on holidays wouldcast a red glow on a town.pass the buck convey blame Poker players pass responsibility for the dealduring a poker game.penny-wise and not a good investment Sometimes one loses perspective by focusing pound-foolish on pennies,causing the loss of pounds (Englishcurrency worth more than a dollar).piece of cake very easy Most people find it simple to eat cake.play hooky stay home without reason In the 1800s,“hook it”meant to escape.play it by ear decide as one goes along Some musicians can play songs without sheetmusic (by ear).play possum pretend to be sleeping Possums protect themselves by lying still.play second fiddle be in an inferior position The first violinist is the most importantmusician in an orchestra.poor as church mice extremely poor A mouse living in a church would have troublefinding a crumb.pound the pavement look very hard People looking for work must go to job sites toapply,and walking pounds pavement.pulled a fast one fooled or cheated someone Baseball pitchers throw fast balls to opponentsto fool them with the speed of the ball.pull strings use influence to get desires Marionettes are puppets that are worked bypulling on strings attached to their limbs. pulling one’s leg fooling someone British muggers used a cane or wire to pulltheir victim’s leg in order to trip him so theycould steal his wallet.pull rug out from under one sabotage,withdraw support Pulling the rug out from under someone wouldcause him or her to fall and not succeed. pulling the wool over eyes tricking In the 19th century,judges wore woolen wigs.Lawyers hoped to fool judges,or pull their wigsover their eyes.punch the clock get to work Time clocks are used in some workplaces tokeep track of employee hours.push the panic button become terrified,overreact During World War II,pilots often pushed thebailout button,causing the crew to bailoutunnecessarily.put foot in one’s mouth say something one shouldn’t If your foot was in your mouth,you couldn't saythe wrong thing.putting on the dog pretentious,flashy display Long ago,Americans copied a Europeancustom and bought small,expensive dogs tohold on their laps.put the screws to exert pressure Screws were once used for torture.put one’s cards on the table not to conceal anything When playing card games,cards are laid on atable at the end of a hand to see who truly hasthe better cards.put the cart before the horse reverse the order of things Often there is an order that must be followed ifthings are to work,and the cart before thehorse wouldn’t work.raining cats and dogs torrential (very hard) rain During heavy rains in 17th-century England,some streets became filthy rivers carrying catsand dogs.raise cain cause a disturbance In the Bible,Adam and Eve’s son Cain kills hisbrother Abel out of jealousy.rat race furious pace of thing This originally referred to a fast 1930s dance,but now refers to keeping ahead of thecompetition with tiring activity.read between the lines examine the details Cryptographers used a code in which thesecret message in a letter was decoded byreading alternate lines.read the riot act express anger at one in The Riot Act of 1714 was written to control thesignificant trouble English middle class and prevent sedition.red herring meant to throw one off track In olden days,escaped prisoners dragged driedred herring behind them to mislead thebloodhounds.right off the bat immediately A baseball hit sharply on the body of a batbrings immediate results.run into a stone wall something hard to overcome A stone wall would be very difficult to passthrough.save for a rainy day plan ahead Since people can’t know what the future willbring,they should prepare for bad times (rainydays).scarce as hen’s teeth very rare Nothing is rarer because hens have no teeth. scratch the surface not all the facts of story Scratches are usually not very deep.shake a leg hurry up Boat travelers would show a leg or stocking tolet the crew know if it was a man or woman inthe hammock.six of one,half a dozen makes no difference If you do the math,you’ll find these are twoof the other names for the same thing.skeleton in the closet secret that can ruin reputation In old story,the world was searched for personwith a perfect reputation.The one they foundturned out to have a skeleton in her closet. smell a rat suspicious A cat can smell a rat before seeing one.sour grapes saying you never wanted In Aesop’s fable,the fox was unable to retrievesomething you couldn’t get the luscious grapes,so he says they are sour. sow one’s wild oats conduct oneself foolishly In agriculture,sowing weed seed instead ofgood grain seed is a senseless practice. sponge off someone take things and not repay Sponges soak things up.spill the beans let the secret out Greeks voted by dropping beans into a jar.Occasionally voters knocked over the jar toreveal the results.split hairs arguing over trivial matters Hair strands are so thin that it was once it wasbelieved they were impossible to split.stick one’s neck out take risks Chickens stick their necks out on the choppingblock so the butcher can chop their heads off. stir crazy restless Stirring requires motion,and confined peoplecrave activity.stir up a hornet’s nest causing lots of trouble Hornets will attack when their nest isdisturbed.stuffed shirt person who is formal Laundered,starched shirts are quite rigid. stool pigeon telling secrets to get others In the past,fowl hunters tied pigeons to stoolsto use as decoys.straight from the horse’s information received from One can tell how old a horse is by looking at mouth the highest authority its teeth.straw that broke the camel's alludes to the final tiny thing A camel can carry about 1200 pounds,but a back (also,last straw)that makes things fall apart straw more might literally break its back. stretch the truth exaggerates To make the truth into something similar yetdifferent might be called “stretching.”strike it rich become wealthy Prospectors’finds of oil,gold,and otherprecious minerals are called strikes.take the bull by the horns face unpleasant situations A bullfighter may grab the horns to tire the bullout.take the cake receive prize or honor Cakes have been awarded as prizes since oldentimes.take with a grain to be skeptical or accept Ancient Roman historian,Pliny the Elder,of salt with reservations originated this saying about being skeptical. talk a blue streak talk rapidly and incessantly Lightening bolts and other fast things seem toleave a blue streak behind them.talk turkey get down to business When Indians and Pilgrims divided the fowlafter hunting,they talked of turkey while doingtheir business.threw a monkey wrench wreck a project If one throws the wrench into the gears,it wrecks the machine.throw in the towel give up A fighter’s manager stops the fight by throwinga towel into the ring when the fighter cannotgo on.throw the book at someone give a severe punishment Judges look in law books to find maximumsentences for criminalstickles funny bone appeals to sense of humor The humerus bone in the upper arm soundslike the word humorous,which means funny. tip of the iceberg small part of larger problem The tip of an iceberg is only a fraction of thewhole;the rest is hidden under the water,concealing its danger.tongue-in-cheek ironic or insincere words Satirical words would not be understood ifone’s tongue was lodged in one’s cheek. touch base contact Baseball players must touch the bases whenthey run around the field after a hit.under the weather sick Cold or rainy weather can cause sickness;also,storms cause ship passengers to feel queasy. under the wire just in time The finish line in horse racing is an imaginarywire;the horse that beats another horse is justunder the wire.up the creek without hopeless situation A boatman in a creek without a paddle would a paddle have no way to move against the current. upper crust richest people Once the top slices of bread were served tonobility.upset the apple cart ruined plans A farmer headed to market would have a messif the cart of apples overturned.walking on air thrilled When someone is happy or elated,they aresaid to rise up as if walking on air.wear heart on sleeve show feelings If people can see what’s in your heart,theyknow how you feel.weather the storm be patient until things improve Sailors had to ride out bad storms.wet behind the ears inexperienced The last place to dry on newborn animals is thesmall indentation behind each ear.wet blanket putting a damper on things Wet blankets are used to put out fires.white elephant useless possession The king of Siam punished courtiers by givingthem rare Albino elephants,which proceededto eat up their money.white lie untruth that causes little harm White represents purity;refers to a harmless lie,possibly meant to spare someone’s feelings. whole kit and caboodle in its entirety This American saying means “the whole lot.”wild-goose chase useless waste of energy In this 16th century horse race,the lead horsecould go in any direction and the other horseshad to follow.win by a landslide get most of the votes Once a landslide starts,it builds momentumand cannot be stopped.wolf in sheep’s clothing enemy disguised as a friend In Aesop’s fable,the wolf dresses up as a sheepin order to catch a sheep for dinner.work like a dog word very hard Sheepdogs work diligently for long periods. worth one’s salt earned salary Roman soldiers used part of pay to buy salt.Salary comes from Latin word for salt (sal). worth weight in gold quite valuable At present gold prices,a 150-pound personwho was worth his weight in gold would beworth a million dollars.wouldn’t touch it with avoid scrupulously Boatmen once used 10-foot poles to movea10-foot pole their boats through shallow water.。