Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHistory substitution: !!:gs/x/y/ and !!:s/x/y/ and ^x^y #453
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


These history substitutions could be covered.
Should mention global search/replace first, as that is more commonly what is needed.
The ^x^y is a quick trick but users need to know it only does first substitution, which can make it highly error prone. More info:
http://stackoverflow.com/questions/2280778/unix-commandline-history-substitution-foobar-for-multiple-replacements
Common error — doesn't do what you'd hope:
Now you just ran
mv bar.txt foo.bakand clobbered your foo.bak backup file!