- NetBSD Manual Pages
CD(1) NetBSD General Commands Manual CD(1)
Powered by man-cgi (2021-06-01).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
cd -- change working directory
Since cd affects the current shell execution environment, it is always
provided as a shell regular built-in. For more information consult the
manual page for the shell in use.
The directory operand is an absolute or relative pathname which becomes
the new working directory. The interpretation of a relative pathname by
cd depends on the CDPATH environment variable (see below).
The following environment variables affect the execution of cd:
CDPATH A colon-separated list of pathnames that refer to direc-
tories. If the directory operand does not begin with a
slash (`/') character, and the first component is not
dot (`.') or dot-dot (`..'), cd searches for the
directory relative to each directory named in the CDPATH
variable, in the order listed. The new working direc-
tory is set to the first matching directory found. An
empty string in place of a directory pathname represents
the current directory. If the new working directory was
derived from CDPATH, it will be printed to the standard
HOME If cd is invoked without arguments and the HOME environ-
ment variable exists and contains a directory name, that
directory becomes the new working directory.
OLDPWD Set to the previous working directory after a directory
change. Not supported by csh(1).
PWD Set to the current working directory.
The cd utility exits 0 on success, and >0 if an error occurs.
csh(1), ksh(1), pwd(1), sh(1), chdir(2)
The cd command is expected to be IEEE Std 1003.2 (``POSIX.2'') compati-
NetBSD 9.3 August 31, 2019 NetBSD 9.3