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:
Run something forever in bash until you want to stop it 13 February 2018
A neat trick to zip a git repo with a version number 01 September 2017
And bash basics 16 October 2015
set -ex - The most useful bash trick of the year 31 August 2014
How I do deployments 16 December 2013
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
I'm Prolog 01 May 2007
Ever wondered how much $87 Billion is? 04 November 2003