Like most users, I have a bunch of aliases set up to give a default set of flags for frequently used programs. For instance,
alias vim='vim -X' alias grep='grep -E' alias ls='ls -G'
The problem is that if I want to use
which to see where my
ls/etc is coming from, the alias gets in the way:
$ which vim vim: aliased to vim -X
This is useful output, but not what I'm looking for in this case; I know
vim is aliased to
vim -X but I want to know where that
vim is coming from.
Short of temporarily un-defining the alias just so I can use
which on it, is there an easy way to have
which 'unwrap' the alias and run itself on that?
Edit: It seems that
which is a shell-builtin with different behaviors across different shells. In Bash, SiegeX's suggestion of the
--skip-alias flag works; however, I'm on Zsh. Does something similar exist there?