Add info about !!, !^, !$ (#844)

* Add info about !!, !^, !$

* Do not use example with sudo
This commit is contained in:
Michael Hienle 2018-11-19 22:09:09 +01:00 committed by chad d
parent 0347f74435
commit 6107936ac2
1 changed files with 4 additions and 1 deletions

View File

@ -490,6 +490,7 @@ History
### Operations ### Operations
| `!!` | Execute last command again |
| `!!:s/<FROM>/<TO>/` | Replace first occurrence of `<FROM>` to `<TO>` in most recent command | | `!!:s/<FROM>/<TO>/` | Replace first occurrence of `<FROM>` to `<TO>` in most recent command |
| `!!:gs/<FROM>/<TO>/` | Replace all occurrences of `<FROM>` to `<TO>` in most recent command | | `!!:gs/<FROM>/<TO>/` | Replace all occurrences of `<FROM>` to `<TO>` in most recent command |
| `!$:t` | Expand only basename from last parameter of most recent command | | `!$:t` | Expand only basename from last parameter of most recent command |
@ -499,7 +500,9 @@ History
### Slices ### Slices
| `!!:n` | Expand only `n`th token from most recent command (command is `0`; first param is `1`) | | `!!:n` | Expand only `n`th token from most recent command (command is `0`; first argument is `1`) |
| `!^` | Expand first argument from most recent command |
| `!$` | Expand last token from most recent command |
| `!!:n-m` | Expand range of tokens from most recent command | | `!!:n-m` | Expand range of tokens from most recent command |
| `!!:n-$` | Expand `n`th token to last from most recent command | | `!!:n-$` | Expand `n`th token to last from most recent command |