Hacker News new | ask | show | jobs
by nfriedly 2439 days ago
FYI, in bash, "sudo !!" re-runs the previous command with sudo.
3 comments

That's not "funny" enough, unless the "!!" is replaced by an emoji.

    papln used multiple exclamation marks and is clearly insane. This incident will be reported.
alias goddammit=sudo !!
I use it all the time! But also worth remembering that !$ is the object of your last command, so you could do something like

cp /some/tortured/path/to/file.txt /some/other/path/file.txt

chown myuser:myuser !$

Thanks for that little tip! It's a constant mistype for me...

    $ apt install something
    E: Unable to acquire the dpkg frontend lock 
      (/var/lib/dpkg/lock-frontend), are you root?