I read `which`, but all but I cannot really get the difference. I am running zsh 5.4.2 on 64-bit debian-buster. Both which and whence are shell-builtins .
Can people point out where whence would be more appropriate than which and vice-versa ?
/home/shirish> zsh --version
zsh 5.4.2 (x86_64-debian-linux-gnu)
/home/shirish> type -a which
which is a shell builtin
which is /usr/bin/which
which is /bin/which
/home/shirish> type -a whence
whence is a shell builtin
whereis
builtin in zsh. There is awhereis
command on BSDs or inutil-linux
, but that has nothing to do withwhence -ca
. Seeinfo zsh where
for the documentation aboutzsh
'swhere
. – Stéphane Chazelas Oct 13 '21 at 15:27zsh
. I was referring to Bash. – dr_ Oct 14 '21 at 11:00