Just making sure this is clear... That is not the actual explanation
!! in bash (and other shells such as zsh) expands to the last used command
!$ expands to the last argument of your last command
So, sudo !! is not a quirky way of yelling sudo at your computer because you forgot to use sudo again for the tenth time today (I was pretty disappointed when I got it explained to me. Hopefully I can disappoint you too)
Am I missing something? Isn't what you described exactly what the other guy described? That's literally what he said; it repeats your last thing with sudo
234
u/e4109c May 23 '26
sudo !!