3 ms·
$ uname Darwin $ which cd /usr/bin/cd
by khrbtxyz 3y ago
$ uname
Darwin
$ which cd
/usr/bin/cd
- traceroute66 3y agoHuh ? Which OS X are you on ? What you posted is not reproducable on Ventura (13.6) % uname Darwin % which cd cd: shell built-in command
- irishsultan 3y agoDepends on your shell, if you execute `which -a cd` it will show you /usr/bin/cd in addition to the built-in command. (zsh has which as a built in command, apparently bash doesn't, which causes the different output). It's unclear to me what /usr/bin/cd actually accomplishes though, even in bash. (final edit I hope, I found an explanation of sorts for /usr/bin/cd: https://unix.stackexchange.com/a/50060 https://unix.stackexchange.com/a/50060)
- traceroute66 3y ago> It's unclear to me what /usr/bin/cd actually accomplishes though, even in bash. Seems to be something they adopted from FreeBSD if the comment in the script is anything to go by ? (`/usr/bin/cd` is a shell script, you can cat it). It seems something to do with it being a POSIX system if this SO answer[1] is anything to go by. Beyond my paygrade though, and given Apple's shell appears to default to the built-in it seems I don't need to care either. :-) [1] https://unix.stackexchange.com/questions/50022/why-cant-i-redirect-a-path-name-output-from-one-command-to-cd/50025#50025 https://unix.stackexchange.com/questions/50022/why-cant-i-re...
- khrbtxyz 3y agoI’m on Ventura 13.6.1. Looks like your which is a shell built-in as well. Try ls /usr/bin/cd