:& repeats bash history expansion substitution. For example:$ echo 1 1 1 1 11 1 1 1 1$ ^1^9echo 9 1 1 1 19 1 1 1 1$ echo 1 1 1 1 11 1 1 1 1$ ^1^9^:&echo 9 9 1 1 19 9 1 1 1$ echo 1 1 1 1 11 1 1 1 1$ ^1^9^:&:&:&:&echo 9 9 9 9 99 9 9 9 9$ As seen above, one needs to type :& for each repetition. Is there a way to repeat substitution for all the matches automatically? I mean something like:$ echo 1 1 1 1 11 1 1 1 1$ ^1^9^:*echo 9 9 9 9 99 9 9 9 9$ 
repeat bash history expansion substitution for all the matches
bash;command history
You can use event designators instead:$ echo 1 1 1 1 11 1 1 1 1$ !!:gs/1/9/echo 9 9 9 9 99 9 9 9 9!! is a word designator which expands to the previous command run. s and g are modifiers:After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a :. s/old/new/Substitute new for the first occurrence of old in the event line. [...]g/aCause changes to be applied over the entire event line. Used in conjunction with s, as in gs/old/new/, or with &.So, !!:gs/1/9/ means run the previous command, replacing all 1s with 9s.