Command path for exit

command linepathterminal

How would I find the command path for exit? I have already tried which exit but that returns nothing (it just goes to a new line).

I have also played around cd /usr/bin, and when in that directory using ls -R, but I haven't found it.

Best Answer

You're not going to find it in any directory because it's a builtin command (man exit):

Shell builtin commands are commands that can be executed within the running shell's process. Note that, in the case of csh(1) builtin commands, the command is executed in a subshell if it occurs as any component of a pipeline except the last.

A list of the Bash builtin commands for macOS can be found at the top of the man page (man builtin).