4

In zsh, when I enter which git it shows:

git: aliased to noglob git 

How do I find out which git binary it actually invokes? (eg: /usr/bin/git vs ~/bin/git). Basically I want to bypass the aliases when I use which.

2
  • Have you tried whereis? Commented Jun 22, 2015 at 4:56
  • @SaulOrtega Didn't know about whereis before. Looks like whereis -b git lists all the git binaries in $PATH. Commented Jun 22, 2015 at 8:53

2 Answers 2

12

For zsh, which is shorthand for whence -c, and supports other whence options. In particular:

-p Do a path search for name even if it is an alias, reserved word, shell function or builtin. 

So:

$ which git git: aliased to noglob git $ which -p git /usr/bin/git 
0
2

Try

 /usr/bin/which git 

it should give you some file path, probably /usr/bin/git

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.