Created
June 14, 2018 22:45
-
-
Save r-pufky/d9598f976ea806f050f1bc0fae0665ff to your computer and use it in GitHub Desktop.
Bash history usage for last command
This file contains 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
!$ - last word of the previous command that was entered (bash) | |
!!:$ - equivalent to !$ | |
$_ - last argument of the previously executed command | |
Example: | |
$ { echo foo; } | |
foo | |
$ echo "$_" | |
foo | |
$ { echo foo; } | |
foo | |
$ echo !$ | |
$ echo } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment