2025-07-24 22:27:13 -06:00
|
|
|
# !
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
> Riutilizza ed espandi la cronologia della shell in `sh`, Bash, Zsh, `rbash` e `ksh`.
|
|
|
|
|
> Vedi anche: `^`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> Maggiori informazioni: <https://gnu.org/software/bash/manual/bash.html#Event-Designators>.
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Sostituisci con il comando precedente ed eseguilo con `sudo`:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`sudo !!`
|
|
|
|
|
|
|
|
|
|
- Sostituisci con un comando in base al numero di riga trovato con `history`:
|
|
|
|
|
|
|
|
|
|
`!{{numero}}`
|
|
|
|
|
|
|
|
|
|
- Sostituisci con un comando che è stato utilizzato un numero specificato di righe indietro:
|
|
|
|
|
|
|
|
|
|
`!-{{numero}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Sostituisci con il comando più recente che inizia con una stringaa:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`!{{stringa}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Sostituisci con tutti gli argomenti dell'ultimo comando:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`{{comando}} !*`
|
2026-02-18 06:55:01 -07:00
|
|
|
|
|
|
|
|
- Sostituisci con l'ultimo argomento dell'ultimo comando:
|
|
|
|
|
|
|
|
|
|
`{{comando}} !$`
|
|
|
|
|
|
|
|
|
|
- Sostituisci con l'ultimo comando ma senza l'ultimo argomento:
|
|
|
|
|
|
|
|
|
|
`!:-`
|
|
|
|
|
|
|
|
|
|
- Stampa l'ultimo comando che inizia con una stringaa senza eseguirlo:
|
|
|
|
|
|
|
|
|
|
`!{{stringa}}:p`
|