History cmd is for list Bash's log of the historical cmd you typed

1. List last n commands

history n

2. Execute cmd No.n

!n

3. Execute last cmd

!!

or

!-

4. Execute command n times before

!-n

5. Execute the last cmd that starts with "string"

!string

6. Execture the last cmd that contains "string"

!?string?

7. Execute the "commandName" with any args you used on your last cmd

commandName !*

Search Command History

Use Ctrl-R then type the command name you used last time, you will see a console window like: 

(reverse−i−search)`':
  • Use Ctrl-R key combination to scroll backword through the history
  • Use Ctrl-R repeatedly to find every string you entered
  • Execute it after finding by [Enter]
  • Right or Left arrow keys to place the cmd on actual bash console

Linux Cmd Tool 系列之—history & search command history的更多相关文章

  1. Linux Cmd Tool 系列之—script & scriptreplay

    Intro Sometime we want to record cmd and outputs in the interactive shell sessions. However history ...

  2. Linux Cmd Tool 系列之—alias

    The alias cmd list your current aliases. For example : alias Use alias to shorten a long cmd in curr ...

  3. Red Gate系列之七 SQL Search 1.1.6.1 Edition SQL查询分析工具使用教程

    原文:Red Gate系列之七 SQL Search 1.1.6.1 Edition SQL查询分析工具使用教程 Red Gate系列之七 SQL Search 1.1.6.1 Edition SQL ...

  4. linux磁盘管理系列-软RAID的实现

    1 什么是RAID RAID全称是独立磁盘冗余阵列(Redundant Array of Independent Disks),基本思想是把多个磁盘组合起来,组合一个磁盘阵列组,使得性能大幅提高. R ...

  5. linux磁盘管理系列二:软RAID的实现

    磁盘管理系列 linux磁盘管理系列一:磁盘配额管理   http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_040_quota.html l ...

  6. linux磁盘管理系列一:磁盘配额管理

    磁盘管理系列 linux磁盘管理系列一:磁盘配额管理   http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_040_quota.html l ...

  7. linux驱动基础系列--linux spi驱动框架分析

    前言 主要是想对Linux 下spi驱动框架有一个整体的把控,因此会忽略某些细节,同时里面涉及到的一些驱动基础,比如平台驱动.设备模型等也不进行详细说明原理.如果有任何错误地方,请指出,谢谢! spi ...

  8. Linux / UNIX create soft link with ln command

    How to: Linux / UNIX create soft link with ln command by NIXCRAFT on SEPTEMBER 25, 2007 · 42 COMMENT ...

  9. linux磁盘管理系列-LVM的使用

    LVM是什么 LVM是Linux操作系统的逻辑卷管理器. 现在有两个Linux版本的LVM,分别是 LVM1,LVM2.LVM1是一种已经被认为稳定了几年的成熟产品,LVM2 是最新最好的LVM版本. ...

随机推荐

  1. 部分安卓手机微信浏览器中使用XMLHttpRequest 2上传图片显示字节数为0的解决办法

    前端JS中使用XMLHttpRequest 2上传图片到服务器,PC端和大部分手机上都正常,但在少部分安卓手机上上传失败,服务器上查看图片,显示字节数为0.下面是上传图片的核心代码: HTML < ...

  2. Ajax_03之接收数据

    1.使用XHR接收服务器返回的数据--text 服务器端:  header('Content-Type:text/plain');  echo 'xxx'; 客户端:  xhr.responseTex ...

  3. AngularJs入门之表单开发

    本文和大家分享的主要是前端开发中必备的AngularJs框架表单开发相关基础知识,希望对大家使用和学习AngularJs有所帮助. 1.简单的表单提交: 2.更多的表单元素: 3.初始化表单: 代码 ...

  4. C#设计模式系列:建造者模式(Builder)

    1.建造者模式简介 1.1>.定义 建造者模式(Builder)将复杂的构建与其表示相分离,使得同样的构建过程可以创建不同的表示. 1.2>.使用频率 中低 1.3>.原型模式应用 ...

  5. Android自用-----WindowManager$BadTokenException: Unable to add window -- token null is not for an application

    转自http://www.cnblogs.com/oakpip/archive/2011/04/06/2007310.html 错误产生: private Context mcontext; @Ove ...

  6. Hibernate的数据删除,更改

    其他未给出代码,请参考上一篇.... 一.数据的删除 方法1.从“多”的一方进行数据的删除 books.hbm.xml文件不变: <many-to-one name="publishe ...

  7. 纯CSS打造忙碌光标

    我们经常会用到忙碌等待的情况,比如ajax等待回调,或者加载页面的时候,我们通常的做法就是放一张loading.gif图片,在那里转呀转. 以前是在pc上用,也没有觉得不妥,如今要在移动端用,问题就来 ...

  8. K & DN 的前世今生(微软开源命名变革)

    一个非常有意思的 Issue:Can we rename K? 在这个 Issue 中,有大量的社区开发者讨论了微软开源命名问题,主要是 K 如何进行替换掉?看来大伙都对微软项目命名有歧义,首先,再次 ...

  9. Deque的部分成员函数 解析,关于这个类,百度有很多解析,唯独没有其函数介绍

    函数 描述 c.assign(beg,end) c.assign(n,elem) 将[beg; end)区间中的数据赋值给c. 将n个elem的拷贝赋值给c. c.at(idx) 传回索引idx所指的 ...

  10. [ES] 基础概念

    Elasticsearch是基于Luence实现的一款搜索引擎,支持分布式和集群,并且搜索近实时,主要用于搜索和数据分析 索引 index 可以理解为数据库中的database,存储的是实际数据,因为 ...