首页 > 代码库 > Linux Cmd Tool 系列之—history & search command history
Linux Cmd Tool 系列之—history & search command history
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
Linux Cmd Tool 系列之—history & search command history
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。