How can I replace ALL instances of a string in the previous command in Bash? [duplicate]

That particular feature is called quick substitution; its documentation can be found in the Event Designators section of the Bash Manual. You can’t do what you want with quick substitution; you’ll have to resort to something slightly more verbose:

!!:gs/foo/bar/

Leave a Comment