Skip to content
The Shell Reliquary

/static/relicario/en/reliquia/palavra-zero/

Menu

SHL-008 · Words

!:0

Just the name of the previous command, with no arguments.

In history-expansion counting, the command is word zero. !:0 rescues just that, ready to take new arguments.

It's the natural partner of !$: one keeps the verb, the other the object. Repeating a long command while changing only the target costs four characters.

$ rsync -av ./campo/ estufa:/coleta/
$ !:0 -av ./viveiro/ estufa:/coleta/
rsync -av ./viveiro/ estufa:/coleta/
The same verb, aimed at another directory.