cd(1) CLIX cd(1)
NAME
cd - Changes current working directory
SYNOPSIS
cd [directory]
DESCRIPTION
The cd command changes the current working directory. If directory is not
specified, the value of shell parameter $HOME is used as the new working
directory. If directory specifies a complete path starting with /, ., ..,
directory becomes the new working directory. If neither case applies, cd
tries to find the designated directory relative to one of the paths
specified by the $CDPATH shell variable. $CDPATH has the same syntax as,
and similar semantics to, the $PATH shell variable. The cd command must
have execute (search) permission in directory.
Because a new process is created to execute each command, cd would be
ineffective if it were written as a normal command; therefore, it is
recognized and is internal to the shell.
EXAMPLES
1. The following example changes current working directory to the user's
home directory:
cd
2. The following example changes current working directory to the
/usr/tmp directory:
cd /usr/tmp
DIAGNOSTICS
Diagnostic messages are issued by the shell.
EXIT VALUES
The cd command returns a value of 0 if successful. If unsuccessful, cd
returns a value of 1.
RELATED INFORMATION
Commands: acc(1), cc(1), pwd(1), sh(1)
Functions: chdir(2)
2/94 - Intergraph Corporation 1