Re:Sl: a mirror version of ls
by blakesterz on Friday March 30, 2018 @10:31AM
(#16716373)
I have a few "idiot aliases" like that...
[ Parent
| on HN ]
> grpe
Every. Single. Time. Sometimes I even typo it many times in a row.
There must be //something// in that combination of letters, because I don't recall ever having that many mistakes with any other commands.
Re:Sl: a mirror version of ls
by lallysingh on Friday March 30, 2018 @05:16PM
(#16719863)
I think that many of my typos occur when switching between letters on one hand vs the other. I figure it's a brain hemisphere synchronization thing.
alias gti='/usr/local/bin/git'
alias gut='/usr/local/bin/git'My personal favorite is:
alias fuck='sudo $(fc -nl -1)'
Be very careful with this.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/
endWhat about the actual program thefuck? It can fix more than just sudo, and asks you to confirm
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.
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 !!I use zsh and I don't know what shopt is. That's two commands and !! doesn't work in aliases.
In zsh it is called setopt. You don't need to make an alias, you would put this in your .bashrc
So why not just type 'sudo !!' ?
Because it isn't as much fun.
I think you can try this.
https://github.com/nvbn/thefuck