bypass 'noglob' for 'which' in zsh?

You can use which -a COMMAND (or where COMMAND or whence -ca COMMAND) to find all occurences of COMMAND in the command path.

For example:

% alias ls='noglob ls'
% ls () /bin/ls
% which ls
ls: aliased to noglob ls
% which -a ls
ls: aliased to noglob ls
ls () {
        /bin/ls
}
/bin/ls

As aliases are replaced in the command line before anything is executed, the second command in the list is the one you are looking for (assuming of course that the first line is somehow aliased to the same name)

Tags:

Alias

Zsh

Which