Skip to content

Instantly share code, notes, and snippets.

@estysdesu
Created March 25, 2020 20:27
Show Gist options
  • Save estysdesu/1bd3167d24bfd493f8bd828c97bbf152 to your computer and use it in GitHub Desktop.
Save estysdesu/1bd3167d24bfd493f8bd828c97bbf152 to your computer and use it in GitHub Desktop.
[Bash: History Expansion] #bash #hist #!!
man -P 'less -p ^HISTORY\ EXPANSION' bash
##### GLOBS #####
!^ # first argument
!$ # last argument
!* # all arguments
!:2 # second argument
!:2-3 # second to third arguments
!:2-$ # second to last arguments
!:2* # second to last arguments
!:2- # second to next to last arguments
!:0 # the command
!! # repeat the previous line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment