I've built an executable which, for the sake of this question, is named foo. There is already a version of it at /usr/bin/foo, and I install a different version as /usr/local/bin/foo. My path has /usr/local/bin before /usr/bin.
Now, if I run which foo, I get /usr/local/bin/foo, as expected. However, when I just just invoke foo, what gets run is /usr/bin/foo (verified this by checking its /proc/1234/exe link where 1234 is the pid).
I've checked my aliases, there's no alias for foo.
What could be the reason /usr/bin/foo is chosen when invoking foo?
Note: I'm running Devuan GNU/Linux 6 (excalibur/ceres).
typeorcommand -vto see what your shell thinks, instead of usingwhich