copying over from Twitter because I am dreadfully inactive here and it's quite interesting!

apparently macOS' whereis searches the paths defined in sysctl user.cs_path, which is very sparsely populated:

> sysctl user.cs_path
user.cs_path: /usr/bin:/bin:/usr/sbin:/sbin

This is in comparison to the typical Linux implementation which searches $PATH, or even that of FreeBSD which uses both cs_path and $PATH

I believe this must be copied from NetBSD, as it matches roughly the same implementation/functionality, down to the mention of 3.0 BSD - shockingly old! OpenBSD has roughly a similar implementation, but hardcodes its paths (roughly the above + X11/libexec specific things) instead of accessing from a sysctl.

Either way, whereis is a menace to my muscle memory. I'll have to learn to rely on zsh's built-in where more often, since that properly uses $PATH...


Oh interesting! You could always just alias whereis=which / alias whereis=where, no?


definitely 🙏 life is now much better

also wow I forgot which exists