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'
.oh-my-zsh/plugins/git/git.plugin.zsh
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.

Comments

Your email will never ever be published


Related posts

Previous:
Real minimal example of going from setState to MobX 04 May 2018
Next:
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
Related by Text:
jQuery and Highslide JS 08 January 2008
I'm back! Peterbe.com has been renewed 05 June 2005
Anti-McCain propaganda videos 12 August 2008
Ever wondered how much $87 Billion is? 04 November 2003
Guake, not Yakuake or Yeahconsole 23 January 2010