source code for unix environments 'cd' command

debugger picture debugger · May 19, 2009 · Viewed 15k times · Source

Where can I find the source code for Unix environment's cd command?

I want to know how the command is implemented.

Answer

Aaron Digulla picture Aaron Digulla · May 19, 2009

Here is a complete explanation how cd works: http://web.archive.org/web/20090515201659/http://www.cs.ucr.edu/~brett/cs153_w02/syscall.html

The cd Unix command just calls chdir and examines the error codes.