News for hackers. Stuff that matters.
Re:Sl: a mirror version of ls by mulmen on Friday March 30, 2018 @11:05AM (#16716658)
My personal favorite is:

   alias fuck='sudo $(fc -nl -1)'
Be very careful with this.
Re:Sl: a mirror version of ls by StavrosK on Friday March 30, 2018 @11:24AM (#16716838)
Here's one of my aliases for you:

    function fuckgit
        rm -rf /tmp/fuckgit/
        git clone --no-checkout (git config --get remote.origin.url) /tmp/fuckgit/
        rm -rf .git/
        mv /tmp/fuckgit/.git .
        rm -rf /tmp/fuckgit/
    end
Re:Sl: a mirror version of ls by epse on Friday March 30, 2018 @11:07AM (#16716684)
What about the actual program thefuck? It can fix more than just sudo, and asks you to confirm
Re:Sl: a mirror version of ls by web007 on Friday March 30, 2018 @11:34AM (#16716936)
Re:Sl: a mirror version of ls by mulmen on Friday March 30, 2018 @11:47AM (#16717078)
I don't want to be asked and I don't want to install anything.

I looked at thefuck but it didn't seem to do anything I needed.

Re:Sl: a mirror version of ls by ben509 on Friday March 30, 2018 @11:24AM (#16716836)
Or make history work for you:

  shopt -s histverify histreedit
Bash will let you then confirm the actual command it's going to run:

  sudo !!
Re:Sl: a mirror version of ls by mulmen on Friday March 30, 2018 @11:47AM (#16717075)
I use zsh and I don't know what shopt is. That's two commands and !! doesn't work in aliases.
Re:Sl: a mirror version of ls by rejschaap on Friday March 30, 2018 @04:06PM (#16719397)
In zsh it is called setopt. You don't need to make an alias, you would put this in your .bashrc
Re:Sl: a mirror version of ls by sethrin on Friday March 30, 2018 @03:31PM (#16719105)
So why not just type 'sudo !!' ?
Re:Sl: a mirror version of ls by mulmen on Friday March 30, 2018 @03:44PM (#16719213)
Because it isn't as much fun.
Re:Sl: a mirror version of ls by oldgun on Friday March 30, 2018 @11:54AM (#16717152)
I think you can try this. https://github.com/nvbn/thefuck