CD(1,C) AIX Commands Reference CD(1,C)
-------------------------------------------------------------------------------
cd
PURPOSE
Changes the currrent directory.
SYNTAX
+- $HOME -----+
cd ---| |---|
+- directory -+
DESCRIPTION
The cd command moves you from your present directory to another. You must have
execute (search) permission in the specified directory.
The cd command is actually a built-in subcommand of the sh and csh commands.
This man page only describes the common behavior of these two subcommands.
Both sh and csh provide shortcut ways to specify directory. The sh command
uses the shell variable CDPATH, while csh uses the shell variable cdpath and
other shell variables. See the sh and csh commands for more details.
Warning: When changing to a directory using a pathname which includes one or
more symbolic links, the real name of the target directory may be different
than the name issued in the cd command. Use the pwd command after the cd
command to determine the actual name of the directory reached. Thereafter
pathnames beginning with ".." will refer to the parent of the actual directory.
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
Processed November 8, 1990 CD(1,C) 1
CD(1,C) AIX Commands Reference CD(1,C)
If the current directory is "/usr/include" and if it contains a
subdirectory named "sys", "/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 directory. Note that .. (dot-dot) is a hard
link to the parent directory. If the current directory was entered via a
symbolic link, the command cd .. may put you in a directory you do not
expect. In the following command sequence, pwd will show "/aixps" (aixps
is the default name of the local filesystem) since "/tmp" is a symbolic
link to "<LOCAL>/tmp".
cd /tmp
cd ..
pwd
RELATED INFORMATION
The following commands: "csh," "pwd," and "sh, Rsh."
The chdir system call in AIX Operating System Technical Reference.
Processed November 8, 1990 CD(1,C) 2