MirBSD manpage: cd(1)

CD(1)                        BSD Reference Manual                        CD(1)


     cd - change working directory


     cd [directory]


     directory is an absolute or relative pathname which becomes the new work-
     ing directory. The interpretation of a relative pathname by cd depends on
     the CDPATH environment variable (see below). For an explanation of the
     directory hierarchy, see hier(7).

     Note that cd is implemented as a built-in shell command and not as a
     stand-alone program. Because each process has its own working directory,
     a separate cd utility would have no effect (it would change the directory
     and exit, leaving the working directory in the parent unchanged). Dif-
     ferent shells may implement cd with features different from those
     described here. Please consult the manual for your specific shell.

     The cd command exits 0 on success or >0 if an error occurred.


     The following environment variables affect the execution of cd:

     CDPATH  If the directory operand does not begin with a slash ('/') char-
             acter, and the first component is not dot ('.') or dot-dot
             ('..'), cd searches for the directory relative to each colon-
             separated directory named in the CDPATH variable, in the order
             listed. The new working directory 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 out-
             put. See sh(1) for details. Users of csh(1) use the variable
             cdpath instead.

     HOME    If cd is invoked without arguments and the HOME environment vari-
             able exists and contains a directory name, that directory becomes
             the new working directory.

     See environ(7) for more information on environment variables.


     csh(1), pwd(1), sh(1), chdir(2), environ(7), hier(7)


     The cd command is expected to be IEEE Std 1003.2 ("POSIX.2") compatible.

MirBSD #10-current               June 5, 1993                                1

Generated on 2021-12-07 11:07:08 by $MirOS: src/scripts/roff2htm,v 1.103 2021/01/23 20:24:35 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2021 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.