Almost by mistake, I figured out you could do something like:
$ cp foo.data bar1.data
$ ^bar1^bar2
And that runs the same command with bar2.data
instead of bar1.data
. Now, how about if I have multiple occurrences of the target word? For example:
$ cp foo.data bar.data
$ ^data^index
It only replaces the first data
extension. How do I get it to replace both?