Skip to content

Instantly share code, notes, and snippets.

@r-pufky
Created June 14, 2018 22:45
Show Gist options
  • Save r-pufky/d9598f976ea806f050f1bc0fae0665ff to your computer and use it in GitHub Desktop.
Save r-pufky/d9598f976ea806f050f1bc0fae0665ff to your computer and use it in GitHub Desktop.
Bash history usage for last command
!$ - 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