Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Apropos / Subsearch:
optional field

 cd(1)								       cd(1)

      cd - change working directory

      cd [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 /, ., or .., 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.	cd must have execute (search) permission in

      cd exists only as a shell built-in command because a new process is
      created whenever a command is executed, making cd useless if written
      and processed as a normal system command.	 Moreover, different shells
      provide different implementations of cd as a built-in utility.
      Features of cd as described here may not be supported by all the
      shells.  Refer to individual shell manual entries for differences.

      If cd is called in a subshell or a separate utility execution
      environment such as:

	   find . -type d -exec cd {}; -exec foo {};

      (which invokes foo on accessible directories) cd does not affect the
      current directory of the caller's environment.  Another usage of cd as
      a stand-alone command is to obtain the exit status of the command.

    International Code Set Support
      Single- and multi-byte character code sets are supported.

      Change the current working directory to the HOME directory from any
      location in the file system:


      Change to new current working directory foo residing in the current

	   cd foo
	   cd ./foo

      Change to directory foobar residing in the current directory's parent

 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000

 cd(1)								       cd(1)

	   cd ../foobar

      Change to the directory whose absolute pathname is

	   cd /usr/local/lib/work.files

      Change to the directory proj1/schedule/staffing/proposals relative to
      home directory:

	   cd $HOME/proj1/schedule/staffing/proposals

      The following environment variables affect the execution of cd:

      HOME		  The name of the home directory, used when no
			  directory operand is specified.

      CDPATH		  A colon-separated list of pathnames that refer to
			  directories.	If the directory operand does not
			  begin with a slash (/) character, and the first
			  component is not dot or dot-dot, cd searches for
			  directory relative to each 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 CDPATH is not set, it is treated as
			  if it was an empty string.

      Upon completion, cd exits with one of the following values:

       0		  The directory was successfully changed.
      >&gt&gt>0		  An error occurred.  The working directory remains

      csh(1), pwd(1), ksh(1), sh-posix(1), sh(1), chdir(2).

      cd: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2

 Hewlett-Packard Company	    - 2 -   HP-UX Release 11i: November 2000