I was trying to create an alias in bash
alias r='!!'
My idea was to create a simple alias r to run the previous command instead of using !! (double exclamation) to run the most recent command as it is hard to type. I know I can alias r='fc -s'
to make this work, but I was trying to understand why I am not able to create an alias for !!
. I want to understand what !!
means to bash and why I'm not able to alias it. I can create alias for other bash builtin commands like alias cdir='cd'
but then why not for !!
Sorry if I couldn't explain properly.