1
0
Fork 0
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:
João Pedro Fonseca Dantas 2021-07-05 16:35:47 -03:00 committed by GitHub
parent 00e4396521
commit 4f714f14de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`: