Created
April 18, 2014 09:35
-
-
Save skarabasakis/d6e9c1ab0baa24d3d82e to your computer and use it in GitHub Desktop.
Reusing bash history with bangs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ !! # Repeat last command | |
$ !x # Repeat last command that started with x | |
$ !?x # Repeat last command that has the substring x | |
$ !10 # Repeat 10th command in the history file | |
$ !-10 # Repeat 10th from last command in the history file | |
$ !!* # Fetch parameters from last command | |
$ !!^ # Fetch first parameter from last command | |
$ !!$ # Fetch last parameter from last command | |
$ !!3 # Fetch third parameter from last command | |
$ !!:s/foo/bar/ # Repeat last command substituting foo for bar | |
$ !!:p # Print last command without running it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment