tcsh shell: cd [-p] [-l] [-n|-v] [name]
The command cd directory changes the working directory of the current shell execution environment (see sh) to directory. If you specify directory as an absolute path name, beginning with /, this is the target directory. cd assumes the target directory to be the name just as you specified it. If you specify directory as a relative path name, cd assumes it to be relative to the current working directory.
If the variable CDPATH is defined in the shell, the built-in cd command searches for a relative path name in each of the directories defined in CDPATH. If cd finds the directory outside the working directory, it displays the new working directory.
Use colons to separate directories in CDPATH. In CDPATH, a null string represents the working directory. For example, if the value of CDPATH begins with a separator character, cd searches the working directory first; if it ends with a separator character, cd searches the working directory last.
Calling cd without arguments sets the working directory to the value of the HOME environment variable, if the variable exists. If there is no HOME variable, cd does not change the working directory.
The form cd old new is an extension to the POSIX standard and optionally to the Korn shell. The shell keeps the name of the working directory in the variable PWD. The cd command scans the current value of PWD and replaces the first occurrence of the string old with the string new. The shell displays the resulting value of PWD, and it becomes the new working directory.
If either directory is a symbolic link to another directory, the behavior depends on the setting of the shell's –o logical option. See the set command for more information.
For cd in the tcsh shell, if a directory name is given, cd changes the tcsh shell's working directory to name. If not, it changes the directory to home. If name is '-' it is interpreted as the previous working directory. If name is not a subdirectory of the current directory (and does not begin with /, ./ or ../), each component of the tcsh variable cdpath is checked to see if it has a subdirectory name. Finally, if all else fails but name is a tcsh shell variable whose value begins with /, then this is tried to see if it is a directory (see also the implicitcd tcsh shell variable).
If more than one of -n or -v is given, -v takes precedence. -p is accepted but does nothing.
See Localization for more information.
cd is a built-in shell command.
POSIX.2, X/Open Portability Guide.
All UNIX systems feature the first form of the command.
The cd old new form of the command is an extension of the POSIX standard.
dirs, popd, pushd, set, sh, tcsh