Hacker News new | past | comments | ask | show | jobs | submit login

Huh ? 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



Depends 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)


> 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-re...


I’m on Ventura 13.6.1. Looks like your which is a shell built-in as well. Try

  ls /usr/bin/cd




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: