mirror of https://github.com/CrimsonTome/tldr.git
parent
ba603ca6c3
commit
03819122c9
|
@ -1,7 +1,7 @@
|
||||||
# bash
|
# bash
|
||||||
|
|
||||||
> Bourne-Again SHell.
|
> Bourne-Again SHell, an `sh`-compatible command line interpreter.
|
||||||
> `sh`-compatible command line interpreter.
|
> See also `histexpand` for history expansion.
|
||||||
> More information: <https://gnu.org/software/bash>.
|
> More information: <https://gnu.org/software/bash>.
|
||||||
|
|
||||||
- Start interactive shell:
|
- Start interactive shell:
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
# history expansion
|
||||||
|
|
||||||
|
> Reuse and expand the shell history in bash or zsh.
|
||||||
|
> More information: <https://www.gnu.org/software/bash/manual/html_node/History-Interaction.html>.
|
||||||
|
|
||||||
|
- Run the previous command:
|
||||||
|
|
||||||
|
`!!`
|
||||||
|
|
||||||
|
- Run the previous command as root:
|
||||||
|
|
||||||
|
`sudo !!`
|
||||||
|
|
||||||
|
- Run a command with the last argument of the previous command:
|
||||||
|
|
||||||
|
`{{command}} !$`
|
||||||
|
|
||||||
|
- Run a command with the first argument of the previous command:
|
||||||
|
|
||||||
|
`{{command}} !^`
|
||||||
|
|
||||||
|
- Run the command `n` lines back in the history:
|
||||||
|
|
||||||
|
`!-{{n}}`
|
||||||
|
|
||||||
|
- Run the most recent command starting with `string`:
|
||||||
|
|
||||||
|
`!{{string}}`
|
||||||
|
|
||||||
|
- Run the previous command, replacing `string1` with `string2`:
|
||||||
|
|
||||||
|
`^{{string1}}^{{string2}}^`
|
||||||
|
|
||||||
|
- Perform a history expansion, but print the command that would be run instead of actually running it:
|
||||||
|
|
||||||
|
`{{!-n}}:p`
|
|
@ -1,7 +1,7 @@
|
||||||
# zsh
|
# zsh
|
||||||
|
|
||||||
> Z SHell.
|
> Z SHell, a `bash` and `sh`-compatible command line interpreter.
|
||||||
> `bash` and `sh`-compatible command line interpreter.
|
> See also `histexpand` for history expansion.
|
||||||
> More information: <https://www.zsh.org>.
|
> More information: <https://www.zsh.org>.
|
||||||
|
|
||||||
- Start interactive command line interpreter:
|
- Start interactive command line interpreter:
|
||||||
|
|
Loading…
Reference in New Issue