CD(1SH) COMMAND REFERENCE CD(1SH) NAME cd, chdir - change the current directory (sh built-in) SYNOPSIS cd [ directory ] DESCRIPTION Cd changes the current directory to directory. The value of the environment variable HOME is used if no directory is given. The environment variable CDPATH specifies the directory search path, which is a colon-separated list of directories. The default value of CDPATH is the null string, which specifies that only the current directory is to be searched. The current directory may be specified anywhere in the search path by either a null entry or the entry of a dot (.). If the specified directory contains a slash (/), the directory search path is ignored. The shell command chdir is the same as cd. EXAMPLES The following example changes the current directory to /bin: cd /bin This means that references to files in /bin can be made by the base name of the file rather than /bin/name. VARIABLES CDPATH Colon-separated list of directories to search for the named directory. HOME The default directory to change to. RETURN VALUE [NO_ERRS] Command completed without error. [NP_ERR] An error occurred that was not a system error. Execution terminated. CAVEATS In shell scripts, a failed cd causes the shell script to be terminated. In csh(1csh), the shell variable cdpath is slightly different from CDPATH. For more information, see cd(1csh). Printed 5/12/88 1
CD(1SH) COMMAND REFERENCE CD(1SH) SEE ALSO break(1sh), cd(1csh), continue(1sh), csh(1csh), echo(1sh), eval(1sh), exec(1sh), exit(1sh), export(1sh), hash(1sh), login(1), pwd(1sh), read(1sh), readonly(1sh), return(1sh), set(1sh), sh(1sh), shift(1sh), test(1sh), times(1sh), trap(1sh), type(1sh), ulimit(1sh), umask(1sh), unset(1sh), wait(1sh), chdir(2), and execve(2). Printed 5/12/88 2
%%index%% na:240,110; sy:350,150; de:500,1063; ex:1563,320; va:1883,269; rv:2152,288; ca:2440,460; se:3212,894; %%index%%000000000135