Add info about !!, !^, !$ (#844)
* Add info about !!, !^, !$ * Do not use example with sudo
This commit is contained in:
parent
0347f74435
commit
6107936ac2
5
bash.md
5
bash.md
|
@ -490,6 +490,7 @@ History
|
|||
|
||||
### Operations
|
||||
|
||||
| `!!` | Execute last command again |
|
||||
| `!!: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 |
|
||||
| `!$:t` | Expand only basename from last parameter of most recent command |
|
||||
|
@ -499,7 +500,9 @@ History
|
|||
|
||||
### 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-$` | Expand `n`th token to last from most recent command |
|
||||
|
||||
|
|
Loading…
Reference in New Issue