<P> Note that executing cd from the command line with no arguments has different effects in different operating systems . For example, if cd is executed without arguments in DOS, OS / 2, or Windows, the current working directory is displayed (equivalent to Unix pwd). If cd is executed without arguments in Unix, the user is returned to the home directory . </P> <P> Executing the cd command within a script or batch file also has different effects in different operating systems . In DOS, the caller's current directory can be directly altered by the batch file's use of this command . In Unix, the caller's current directory is not altered by the script's invocation of the cd command . This is because in Unix, the script is usually executed within a subshell . </P> <P> cd is frequently included built directly into a command - line interpreter . This is the case in most of the Unix shells (Bourne shell, tcsh, bash, etc .), cmd. exe and Windows PowerShell on Windows and COMMAND.COM on DOS . </P> <P> Command line shells on Windows usually use the Windows API to change the current working directory, whereas on Unix systems cd calls the chdir () POSIX C function . This means that when the command is executed, no new process is created to migrate to the other directory as is the case with other commands such as ls . Instead, the shell itself executes this command . This is because, when a new process is created, child process inherits the directory in which the parent process was created . If the cd command inherits the parent process' directory, then the objective of the command cd will never be achieved . </P>

How to use the cd command in cmd