I encountered a Linux command, builtin cd.
In fact, I made some researches about the difference, but I could not find a remarkable and significant explanation about this.
In most instances, there is no difference (but see below). The cd command is a built-in command in all shells. It needs to be built-in1 as an external command can not change the environment of the invoking shell, and changing the working directory constitutes a change in its environment.
The bash command builtin forces the shell to use the built-in version of a command, even though there may be a shell function, alias, or external command available with the same name.
In the case where there is e.g. a shell function with the name cd, then builtin cd would not call that. Using builtin cd bypasses any overloaded functionality that may have been added through a shell function or alias by the user.
where __update_prompt is some other user-supplied function that outputs a string.
The builtin cd in the function would not call the function recursively. Using builtin cd in a shell where this function is active, would additionally not call the function.
1There are Unices with an external cd command (macOS, and, I believe, Solaris). The purpose of that command, which can't change the working directory for a shell, is possibly to satisfy the POSIX standard, which lists cd as one of the external utilities that should be available (cd is not one of the "special builtin utilities"). It may also serve as a test to see whether changing work directory to a given directory would be possible.
Not the answer you're looking for? Browse other questions tagged bash shell cd-command or ask your own question.