设为首页 加入收藏

TOP

Linux Cmd Tool 系列之—history & search command history
2017-10-13 09:58:28 】 浏览:5510
Tags:Linux Cmd Tool 系列 history search command

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

!-1

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
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇apache如何开启gzip压缩 下一篇Linux基础之-元字符

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目