Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 10
    Of course you use !! to repeat the previous command in its entirety, unaltered, but almost anything that begins with !!: can be shortened to !:; e.g., !:gs/string1/string2. Commented Jan 21, 2016 at 19:48
  • 4
    The ^ syntax works in zsh as well. Just documenting for posterity. Commented Jun 23, 2017 at 19:24
  • 10
    ^foo^bar^:G for global search and replace. Commented Sep 3, 2018 at 10:48
  • 4
    @HappyFace "^foo^bar^:G for global search and replace." Doesn't work for me in Bash 4.4.19. Is that a zsh syntax? Commented Jul 29, 2020 at 18:49
  • 1
    @wisbucky Yeah, it's zsh. Commented Jul 29, 2020 at 23:18