bash 历史扩展
来源:互联网 发布:济南编程培训 编辑:程序博客网 时间:2024/05/24 07:02
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.
-y’ abbreviates
x-y A range of words;0-y'.
1-
* All of the words but the zeroth. This is a synonym for
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.
- bash 历史扩展
- bash扩展
- bash扩展
- 定制Bash历史命令
- bash 调用历史命令
- Bash历史命令
- Bash的历史命令
- bash中的历史命令
- 完善bash历史命令审核
- man bash 7 扩展
- Linux bash 扩展
- bash简单命令扩展
- bash扩展功能总结
- 修改linux的bash历史参数
- 如何防止丢失任何 bash 历史命令?
- 命令历史:bash的特性之一
- 【Bash百宝箱】shell历史命令(history)
- 关于 bash 记录命令历史.bash_history
- hdu5045 Contest ---- 状态DP
- Android ORM 框架之 greenDAO 使用心得
- 基因数据处理32之Avocado运行记录(人造数据集)
- parted命令详解
- Android判断屏幕锁屏的方法总结
- bash 历史扩展
- 第十三周上机实践——项目3-形状类族中的纯虚函数
- Python学习 (八 IO编程)
- jq_get
- Minimum Height Trees
- java设计模式-状态模式
- CentOS6 下rsync服务器配置
- Shell脚本调试技巧
- iphone访问限制密码忘记了怎么办