cd
PURPOSE
Changes the current directory.
SYNOPSIS
cd [ directory ]
DESCRIPTION
The cd command moves you from your present directory to
another. You must have execute (search) permission in
the specified directory.
If you do not specify a directory, cd moves you to your
login directory ($HOME). If the specified directory name
is a full path name, it becomes the current directory. A
full path name begins with a "/" (slash--root directory),
with a "." (dot--current directory), or with a ".." (dot
dot--parent directory). If the directory name is not a
full path name, cd searches for it relative to one of the
paths specified by the $CDPATH shell variable. This var-
iable has the same syntax as, and similar semantics to,
the $PATH shell variable. (See "Shell Variables and
Command-Line Substitutions" for a discussion of these
variables.)
EXAMPLES
1. To change to your home directory:
cd
2. To change to an arbitrary directory:
cd /usr/include
This changes the current directory to "/usr/include".
Now file path names that do not begin with "/" or
"../" specify files located in "/usr/include".
3. To go down one level of the directory tree:
cd sys
If the current directory is "/usr/include" and if it
contains a subdirectory named "sys", then
"/usr/include/sys" becomes the current directory.
4. To go up one level of the directory tree:
cd ..
The special file name .. (dot-dot) always refers to
the directory immediately above the current direc-
tory.
RELATED INFORMATION
The following commands: "csh," "pwd," and "sh."
Note: The csh command contains a built-in subcommand
named cd. The command and subcommand do not necessarily
work the same way. For information on the subcommand,
see the csh command.
The chdir system call in AIX Operating System Technical
Reference.