How I found out where a bash alias was set up

09 May 2018   0 comments   Linux

I wanted to install a command line tool called gg. But for some reason, gg was already tied to an alias. No problem, I'll just delete that alias. I looked in ~/.bash_profile and I looked in ~/.zshrc and it wasn't there!

But here's how I managed to figure out where it came from:

▶ which gg
gg: aliased to git gui citool

Then I copied the git gui citool part of that output and ran:

▶ rg --hidden 'git gui citool'
104:alias gg='git gui citool'
105:alias gga='git gui citool --amend'

A ha! So it was .oh-my-zsh/plugins/git/git.plugin.zsh that was the culprit. Totally forgot about the plugin. It's full of other useful aliases so I just commented out the one(s) I knew I don't need any more.

By the way rg, aka. ripgrep is probably one of the best tools I have. I use it so often that it's attached to my belt rather than in my toolbox.


Your email will never ever be published

Related posts

Real minimal example of going from setState to MobX 04 May 2018
Always return namespaces in Django REST Framework 11 May 2018
Related by Keyword:
elapsed function in bash to print how long things take 12 December 2018
The best grep tool in the world; ripgrep 19 June 2018
How to unset aliases set by Oh My Zsh 14 June 2018
How to NOT start two servers on the same port 11 June 2018
Run something forever in bash until you want to stop it 13 February 2018