mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
histexpand: add !N
and !?string?
commands (#6051)
This commit is contained in:
parent
00e4396521
commit
4f714f14de
1 changed files with 7 additions and 7 deletions
|
@ -3,11 +3,7 @@
|
|||
> Reuse and expand the shell history in `sh`, `bash`, `zsh`, `rbash` and `ksh`.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/History-Interaction>.
|
||||
|
||||
- Run the previous command:
|
||||
|
||||
`!!`
|
||||
|
||||
- Run the previous command as root:
|
||||
- Run the previous command as root (`!!` is replaced by the previous command):
|
||||
|
||||
`sudo !!`
|
||||
|
||||
|
@ -19,13 +15,17 @@
|
|||
|
||||
`{{command}} !^`
|
||||
|
||||
- Run the Nth command of the history:
|
||||
|
||||
`!{{n}}`
|
||||
|
||||
- Run the command `n` lines back in the history:
|
||||
|
||||
`!-{{n}}`
|
||||
|
||||
- Run the most recent command starting with `string`:
|
||||
- Run the most recent command containing `string`:
|
||||
|
||||
`!{{string}}`
|
||||
`!?{{string}}?`
|
||||
|
||||
- Run the previous command, replacing `string1` with `string2`:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue