博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bash 历史扩展
阅读量:2242 次
发布时间:2019-05-09

本文共 2322 字,大约阅读时间需要 7 分钟。

Event Designators

一个事件标志是在历史列表中的命令行条目的参考。除非引用是绝对的,事件是相对于在历史列表中的当前位置。
!
启动历史替换
!n
请参阅命令n行。
!-n
参照当前命令减去ñ。
!!
请参考前面的命令。
!string
请参阅开始用绳子历史记录列表中的当前位置前的最新命令。
!?string[?]
指在包含字符串历史列表中的当前位置之前的最近的命令。尾随?如果字符串是由一个新行紧接着可以省略。
^string1^string2^
快速替换。重复前面的命令,以string2替换字符串string1。.
!#
整个命令行到目前为止输入。

Word Designators

字标志用于选择从该事件所需的词语。它可能如果被忽略 单词标志始于^,$,*, - ,或%。字是从该行的开始编号,与第一个字由0(零)来表示。字插入由单个空格分隔当前行。

0 (zero)

The zeroth word. For the shell, this is the command word.
n The nth word.
^ The first argument. That is, word 1.
$ The last word. This is usually the last argument, but will expand to the zeroth word if there is only one word in the line.
% The word matched by the most recent ?string?' search.
x-y A range of words;
-y’ abbreviates 0-y'.
* All of the words but the zeroth. This is a synonym for
1- .Itisnotanerrortouseifthereisjustonewordintheevent;theemptystringisreturnedinthatcase.xAbbreviatesx .
x- Abbreviates x-$ like x*, but omits the last word.
如果一个字指示符没有事件规范提供时,先前的命令被用作该事件。

Modifiers

h Remove a trailing filename component, leaving only the head.
t Remove all leading filename components, leaving the tail.
r Remove a trailing suffix of the form .xxx, leaving the basename.
e Remove all but the trailing suffix.
p Print the new command but do not execute it.
q Quote the substituted words, escaping further substitutions.
x Quote the substituted words as with q, but break into words at blanks and newlines.
s/old/new/
Substitute new for the first occurrence of old in the event line. Any delimiter can be used in place of /. The final delimiter is optional if it is
the last character of the event line. The delimiter may be quoted in old and new with a single backslash. If & appears in new, it is replaced by old.
A single backslash will quote the &. If old is null, it is set to the last old substituted, or, if no previous history substitutions took place, the
last string in a !?string[?] search.
& Repeat the previous substitution.
g Cause changes to be applied over the entire event line. This is used in conjunction with :s' (e.g.,:gs/old/new/’) or :&'. If used with:s’, any
delimiter can be used in place of /, and the final delimiter is optional if it is the last character of the event line. An a may be used as a synonym
for g.
G Apply the following `s’ modifier once to each word in the event line.

转载地址:http://xnwdb.baihongyu.com/

你可能感兴趣的文章
找出不在预定数组中的自然数
查看>>
String常见面试题
查看>>
直插,快排,堆排,归并排序的分析
查看>>
二叉树的各种操作(面试必备)
查看>>
oracle
查看>>
泛型与通配符详解
查看>>
BaseServiceImpl中的实现关键点
查看>>
Struts2中的session、request、respsonse获取方法
查看>>
如何理解MVC模型
查看>>
SpringMVC中乱码解决方案
查看>>
SpringMVC中时间格式转换的解决方案
查看>>
post和get请求相关知识点
查看>>
关于try finally 中的return语句的问题
查看>>
RequestBody/ResponseBody处理Json数据
查看>>
springmvc请求参数获取的几种方法
查看>>
在eclipse中创建和myeclipse一样的包结构
查看>>
Java中的IO流
查看>>
java中的关键字
查看>>
如果某个方法是静态的,它的行为就不具有多态性
查看>>
优化Hibernate所鼓励的7大措施
查看>>